From: Eugene Syromiatnikov Date: Sun, 10 Aug 2025 00:00:25 +0000 (+0200) Subject: test/sanitytest.c: fix setitimer usage in timer disarmament X-Git-Tag: openssl-3.6.0-alpha1~187 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1b1a859d3d8aafbdda2977f9955ceee6f32f7ea4;p=thirdparty%2Fopenssl.git test/sanitytest.c: fix setitimer usage in timer disarmament It is incorrect to call setitimer(which, NULL, NULL) to disarm a timer, Linux just gives a pass on that; properly provide a zeroed-out structure instead. Fixes: 760929f6ba18 "crypto/sleep.c: avoid returning early due to signal" Reported-by: Neil Horman Signed-off-by: Eugene Syromiatnikov Reviewed-by: Paul Dale Reviewed-by: Saša Nedvědický Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/28215) --- diff --git a/test/sanitytest.c b/test/sanitytest.c index 2dab0340dee..f17ca4592f6 100644 --- a/test/sanitytest.c +++ b/test/sanitytest.c @@ -189,7 +189,9 @@ static int test_sanity_sleep(int i) #if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L /* disarm the timer */ do { - if (setitimer(ITIMER_REAL, NULL, NULL)) { + static const struct itimerval it; + + if (setitimer(ITIMER_REAL, &it, NULL)) { TEST_perror("test_sanity_sleep: disarm setitimer"); break; }