summaryrefslogtreecommitdiffstats
path: root/lib/libssl/ssl_methods.c
diff options
context:
space:
mode:
authorcheloha <cheloha@openbsd.org>2020-10-13 17:33:39 +0000
committercheloha <cheloha@openbsd.org>2020-10-13 17:33:39 +0000
commit853fa00d2edbe570b1c260535197afb1780eb433 (patch)
tree272f9ac691d9ee62f6be28d4238aeced936b92b2 /lib/libssl/ssl_methods.c
parentsetitimer(2): realitexpire(): call getnanouptime(9) once (diff)
downloadwireguard-openbsd-853fa00d2edbe570b1c260535197afb1780eb433.tar.xz
wireguard-openbsd-853fa00d2edbe570b1c260535197afb1780eb433.zip
setitimer(2): zero itv.it_interval if itv.it_value is zero
If itv.it_value is zero we cancel the timer. When we cancel the timer we don't care about itv.it_interval because the timer is not running: we don't use it, we don't look at it, etc. To be on the paranoid side, I think we should zero itv.it_interval when itv.it_value is zero. No need to write arbitrary values into the process struct if we aren't required to. The standard is ambiguous about what should happen in this case, i.e. the value of olditv after the following code executes is unspecified: struct itimerval newitv, olditv; newitv.it_value.tv_sec = newitv.it_value.tv_usec = 0; newitv.it_interval.tv_sec = newitv.it_interval.tv_usec = 1; setitimer(ITIMER_REAL, &newitv, NULL); getitimer(ITIMER_REAL, &olditv); This change should not break any real code.
Diffstat (limited to 'lib/libssl/ssl_methods.c')
0 files changed, 0 insertions, 0 deletions