]> granicus.if.org Git - libevent/commit
Avoid possible SEGVs in select() (in unit tests)
authorPhilip Prindeville <philipp@redfish-solutions.com>
Wed, 28 Mar 2018 14:25:28 +0000 (08:25 -0600)
committerAzat Khuzhin <a3at.mail@gmail.com>
Thu, 29 Mar 2018 22:24:25 +0000 (01:24 +0300)
commit33baa4e59fbf9432d77a19c6b2b45402580b79a5
treed8265f3ce21fc4f8e5f371cd0dfa855568a0fb1b
parent4ba48739673060baea581774992970fa46c2f813
Avoid possible SEGVs in select() (in unit tests)

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
evutil_time.c