]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
hurd: Do not check for xstate level if it was not initialized
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 21 Apr 2025 17:45:02 +0000 (19:45 +0200)
committerSamuel Thibault <samuel.thibault@ens-lyon.org>
Mon, 21 Apr 2025 17:46:24 +0000 (19:46 +0200)
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

index db756e8a1f6fccfb6394e3d35b640451477a75de..02510b178c46663e34f66a486bb2e8524b275914 100644 (file)
@@ -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;