summaryrefslogtreecommitdiff
path: root/i386
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-02-04 13:03:48 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-02-04 13:03:48 +0100
commita9f5cf5d2ff55abdd05a2ab6965d8b4ba190eac9 (patch)
treeb8941b26b350dfea1d6693a8b4a34751080e0fc3 /i386
parent03c81daf88237a9d32858310d597729ca923db61 (diff)
Fix FPU state access
Found by coverity. * i386/i386/fpu.c (fpu_set_state, fpu_get_state): Fix out of bound `user_fp_regs' access.
Diffstat (limited to 'i386')
-rw-r--r--i386/i386/fpu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c
index fd5f4b6..62a4e67 100644
--- a/i386/i386/fpu.c
+++ b/i386/i386/fpu.c
@@ -374,7 +374,7 @@ ASSERT_IPL(SPL0);
ifps->xfp_save_state.fp_dp = user_fp_state->fp_dp;
ifps->xfp_save_state.fp_ds = user_fp_state->fp_ds;
for (i=0; i<8; i++)
- memcpy(&ifps->xfp_save_state.fp_reg_word[i], &user_fp_regs[i], sizeof(user_fp_regs[i]));
+ memcpy(&ifps->xfp_save_state.fp_reg_word[i], &user_fp_regs->fp_reg_word[i], sizeof(user_fp_regs[i]));
} else {
ifps->fp_save_state.fp_control = user_fp_state->fp_control;
ifps->fp_save_state.fp_status = user_fp_state->fp_status;
@@ -467,7 +467,7 @@ ASSERT_IPL(SPL0);
user_fp_state->fp_dp = ifps->xfp_save_state.fp_dp;
user_fp_state->fp_ds = ifps->xfp_save_state.fp_ds;
for (i=0; i<8; i++)
- memcpy(&user_fp_regs[i], &ifps->xfp_save_state.fp_reg_word[i], sizeof(user_fp_regs[i]));
+ memcpy(&user_fp_regs->fp_reg_word[i], &ifps->xfp_save_state.fp_reg_word[i], sizeof(user_fp_regs[i]));
} else {
user_fp_state->fp_control = ifps->fp_save_state.fp_control;
user_fp_state->fp_status = ifps->fp_save_state.fp_status;