ia32_get_fpcontext(): xfpusave can be legitimately NULL

Reported by:	cy
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Fixes:	bd9e0f5df6
This commit is contained in:
Konstantin Belousov
2021-09-22 00:09:34 +03:00
parent ae5a522cae
commit c2ee4dfd04
+2
View File
@@ -99,6 +99,8 @@ ia32_get_fpcontext(struct thread *td, struct ia32_mcontext *mcp,
bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0], bcopy(get_pcb_user_save_td(td), &mcp->mc_fpstate[0],
sizeof(mcp->mc_fpstate)); sizeof(mcp->mc_fpstate));
mcp->mc_fpformat = fpuformat(); mcp->mc_fpformat = fpuformat();
if (xfpusave == NULL)
return;
if (!use_xsave || cpu_max_ext_state_size <= sizeof(struct savefpu)) { if (!use_xsave || cpu_max_ext_state_size <= sizeof(struct savefpu)) {
*xfpusave_len = 0; *xfpusave_len = 0;
*xfpusave = NULL; *xfpusave = NULL;