Looks like there was garbage, since evutil_configure_monotonic_time_()
does not reset evutil_monotonic_timer structure, while in case of
fallback it uses two fields from it:
- last_time
- adjust_monotonic_clock
Fixes: https://github.com/libevent/libevent/issues/1495
Per the POSIX definition of select():
http://pubs.opengroup.org/onlinepubs/009696699/functions/pselect.html
"Upon successful completion, the select() function may modify the object
pointed to by the timout argument."
If "struct timeval" pointer is a "static const", it could potentially
be allocated in a RO text segment. The kernel would then try to copy
back the modified value (with the time remaining) into a read-only
address and SEGV.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Closes: #614
As pointed in https://github.com/libevent/libevent/pull/417#issuecomment-267860738
"code is unsafe because in evutil_date_rfc1123() the pointer to the
automatic variable struct tm cur is used outside the scope it defined."
Checked with `clang -fsanitize=address -fsanitize-address-use-after-scope`
and test that call evutil_date_rfc1123() with tm==NULL