From 0f2df19d9535d234b31c65f84a6c67ac2e0bd027 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 21 Apr 2025 19:45:02 +0200 Subject: [PATCH] hurd: Do not check for xstate level if it was not initialized If __thread_get_state failed, there is no xstate level to check. ok is 0 already and the memory exists, but better not read uninitialized memory. --- sysdeps/mach/hurd/x86/trampoline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sysdeps/mach/hurd/x86/trampoline.c b/sysdeps/mach/hurd/x86/trampoline.c index db756e8a1f..02510b178c 100644 --- a/sysdeps/mach/hurd/x86/trampoline.c +++ b/sysdeps/mach/hurd/x86/trampoline.c @@ -289,7 +289,7 @@ _hurd_setup_sighandler (struct hurd_sigstate *ss, const struct sigaction *action (thread_state_t) stackframe->xstate, &got) && got == (xstate_size / sizeof (int))); - if (((struct i386_xfloat_state*) stackframe->xstate)->fp_save_kind > 5) + if (ok && ((struct i386_xfloat_state*) stackframe->xstate)->fp_save_kind > 5) /* We support up to XSAVES */ ok = 0; -- 2.47.2