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-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fheads%2Fopenssl-3.4;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) (cherry picked from commit 1b1a859d3d8aafbdda2977f9955ceee6f32f7ea4) --- diff --git a/test/sanitytest.c b/test/sanitytest.c index 0b4d4a6a7c3..282ad64f1ac 100644 --- a/test/sanitytest.c +++ b/test/sanitytest.c @@ -192,7 +192,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; }