]> Git Repo - qemu.git/commit - target/cris/translate.c
target-cris/translate.c: fix out of bounds read
authorzhanghailiang <[email protected]>
Mon, 17 Nov 2014 05:57:34 +0000 (13:57 +0800)
committerPaolo Bonzini <[email protected]>
Mon, 17 Nov 2014 12:59:23 +0000 (13:59 +0100)
commitfae38221e78fc9f847965f6d18b359b8044df348
treef34239a249594acc310c572682c63904d9fa9197
parent0e8b439ae57ee3c46fb95e1775ea038d34496346
target-cris/translate.c: fix out of bounds read

In function t_gen_mov_TN_preg and t_gen_mov_preg_TN, The begin check about the
validity of in-parameter 'r' is useless. We still access cpu_PR[r] in the
follow code if it is invalid. Which will be an out-of-bounds read error.

Fix it by using assert() to ensure it is valid before using it.

Signed-off-by: zhanghailiang <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
target-cris/translate.c
This page took 0.021326 seconds and 4 git commands to generate.