mirror of
https://git.gnunet.org/libmicrohttpd.git
synced 2026-09-25 04:09:31 +03:00
Fixing issue mentioned below.
From: Jesse Anderton <squishyent@gmail.com> To: Christian Grothoff <christian@grothoff.org> Date: Yesterday 11:50:56 pm Christian, I'm not sure whether this counts as a bug or not, but I found that if you use MHD_OPTION_CIPHER_ALGORITHM or MHD_OPTION_PROTOCOL_VERSION in MHD_start_daemon() without using MHD_USE_SSL a SIGSEGV will result. This signal is sent because the daemon's priority_cache member is dereferenced in MHD_start_daemon_va(), but this member is only initialized if MHD_USE_SSL is used. This doesn't affect me: a workaround is easy. I just wanted to make sure you were aware of it. Regards, Jesse
This commit is contained in:
+34
-6
@@ -1248,18 +1248,46 @@ parse_options_va (struct MHD_Daemon *daemon,
|
||||
break;
|
||||
#if HTTPS_SUPPORT
|
||||
case MHD_OPTION_PROTOCOL_VERSION:
|
||||
_set_priority (&daemon->priority_cache->protocol,
|
||||
va_arg (ap, const int *));
|
||||
if (daemon->options & MHD_USE_SSL)
|
||||
_set_priority (&daemon->priority_cache->protocol,
|
||||
va_arg (ap, const int *));
|
||||
#if HAVE_MESSAGES
|
||||
else
|
||||
FPRINTF (stderr,
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_SSL not set\n",
|
||||
opt);
|
||||
#endif
|
||||
break;
|
||||
case MHD_OPTION_HTTPS_MEM_KEY:
|
||||
daemon->https_mem_key = va_arg (ap, const char *);
|
||||
if (daemon->options & MHD_USE_SSL)
|
||||
daemon->https_mem_key = va_arg (ap, const char *);
|
||||
#if HAVE_MESSAGES
|
||||
else
|
||||
FPRINTF (stderr,
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_SSL not set\n",
|
||||
opt);
|
||||
#endif
|
||||
break;
|
||||
case MHD_OPTION_HTTPS_MEM_CERT:
|
||||
daemon->https_mem_cert = va_arg (ap, const char *);
|
||||
if (daemon->options & MHD_USE_SSL)
|
||||
daemon->https_mem_cert = va_arg (ap, const char *);
|
||||
#if HAVE_MESSAGES
|
||||
else
|
||||
FPRINTF (stderr,
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_SSL not set\n",
|
||||
opt);
|
||||
#endif
|
||||
break;
|
||||
case MHD_OPTION_CIPHER_ALGORITHM:
|
||||
_set_priority (&daemon->priority_cache->cipher,
|
||||
va_arg (ap, const int *));
|
||||
if (daemon->options & MHD_USE_SSL)
|
||||
_set_priority (&daemon->priority_cache->cipher,
|
||||
va_arg (ap, const int *));
|
||||
#if HAVE_MESSAGES
|
||||
else
|
||||
FPRINTF (stderr,
|
||||
"MHD HTTPS option %d passed to MHD but MHD_USE_SSL not set\n",
|
||||
opt);
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
case MHD_OPTION_EXTERNAL_LOGGER:
|
||||
|
||||
Reference in New Issue
Block a user