libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 7710e63cdf6cf4a113ea30169308e73963c77566
parent 0ebdff94d461abd4328cf45a6281c15139a045eb
Author: Christian Grothoff <christian@grothoff.org>
Date:   Fri,  2 Mar 2018 22:05:15 +0100

work around silly address sanitizer alignment warning

Diffstat:
Msrc/microhttpd/test_upgrade.c | 16++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c @@ -1047,13 +1047,14 @@ test_upgrade (int flags, #endif /* HTTPS_SUPPORT */ if (NULL == d) return 2; - real_flags = MHD_get_daemon_info(d, - MHD_DAEMON_INFO_FLAGS); + real_flags = MHD_get_daemon_info (d, + MHD_DAEMON_INFO_FLAGS); if (NULL == real_flags) abort (); dinfo = MHD_get_daemon_info (d, MHD_DAEMON_INFO_BIND_PORT); - if (NULL == dinfo || 0 == dinfo->port) + if ( (NULL == dinfo) || + (0 == dinfo->port) ) abort (); if (!test_tls || TLS_LIB_GNUTLS == use_tls_tool) { @@ -1072,12 +1073,19 @@ test_upgrade (int flags, { #if defined(HTTPS_SUPPORT) && defined(HAVE_FORK) && defined(HAVE_WAITPID) MHD_socket tls_fork_sock; + uint16_t port; + + /* make address sanitizer happy */ + memcpy (&port, + &dinfo->port, + sizeof (port)); if (-1 == (pid = gnutlscli_connect (&tls_fork_sock, - dinfo->port))) + port))) { MHD_stop_daemon (d); return 4; } + sock = wr_create_from_plain_sckt (tls_fork_sock); if (NULL == sock) abort ();