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:
Christian Grothoff
2010-02-20 09:00:45 +00:00
parent ab7f657241
commit f50c8e40b5
+34 -6
View File
@@ -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: