mirror of
https://github.com/emikulic/darkhttpd.git
synced 2023-08-10 21:13:08 +03:00
Memory sanitizer workaround: unpoison fd_sets.
This is necessary with clang-9, maybe earlier.
This commit is contained in:
parent
e2e693e1cf
commit
27e489aab7
13
darkhttpd.c
13
darkhttpd.c
@ -70,6 +70,12 @@ static const int debug = 1;
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#if defined(__has_feature)
|
||||||
|
# if __has_feature(memory_sanitizer)
|
||||||
|
# include <sanitizer/msan_interface.h>
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef __sun__
|
#ifdef __sun__
|
||||||
# ifndef INADDR_NONE
|
# ifndef INADDR_NONE
|
||||||
# define INADDR_NONE -1
|
# define INADDR_NONE -1
|
||||||
@ -2372,6 +2378,13 @@ static void httpd_poll(void) {
|
|||||||
}
|
}
|
||||||
#undef MAX_FD_SET
|
#undef MAX_FD_SET
|
||||||
|
|
||||||
|
#if defined(__has_feature)
|
||||||
|
# if __has_feature(memory_sanitizer)
|
||||||
|
__msan_unpoison(&recv_set, sizeof(recv_set));
|
||||||
|
__msan_unpoison(&send_set, sizeof(send_set));
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* -select- */
|
/* -select- */
|
||||||
if (debug) {
|
if (debug) {
|
||||||
printf("select() with max_fd %d timeout %d\n",
|
printf("select() with max_fd %d timeout %d\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user