[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/12] lm32-dis: fix NULL pointer dereference
From: |
Michael Walle |
Subject: |
[Qemu-devel] [PATCH 02/12] lm32-dis: fix NULL pointer dereference |
Date: |
Wed, 6 Mar 2013 22:59:59 +0100 |
Signed-off-by: Michael Walle <address@hidden>
---
disas/lm32.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/disas/lm32.c b/disas/lm32.c
index a8eefe0..1718c86 100644
--- a/disas/lm32.c
+++ b/disas/lm32.c
@@ -303,11 +303,11 @@ int print_insn_lm32(bfd_vma memaddr, struct
disassemble_info *info)
}
case 'c': {
uint8_t csr;
- const char *csr_name;
+ const Lm32CsrInfo *info;
csr = (op >> 21) & 0x1f;
- csr_name = find_csr_info(csr)->name;
- if (csr_name) {
- fprintf_fn(stream, "%s", csr_name);
+ info = find_csr_info(csr);
+ if (info) {
+ fprintf_fn(stream, "%s", info->name);
} else {
fprintf_fn(stream, "0x%x", csr);
}
--
1.7.2.5
- [Qemu-devel] [PATCH 00/12] target-lm32: various fixes, Michael Walle, 2013/03/06
- [Qemu-devel] [PATCH 02/12] lm32-dis: fix NULL pointer dereference,
Michael Walle <=
- [Qemu-devel] [PATCH 01/12] target-lm32: fix debug memory access, Michael Walle, 2013/03/06
- [Qemu-devel] [PATCH 03/12] milkymist-uart: fix receive buffering, Michael Walle, 2013/03/06
- [Qemu-devel] [PATCH 04/12] lm32_uart: fix receive buffering, Michael Walle, 2013/03/06
- [Qemu-devel] [PATCH 05/12] target-lm32: don't log cpu state in translation, Michael Walle, 2013/03/06
- [Qemu-devel] [PATCH 09/12] target-lm32: flush tlb after clearing env, Michael Walle, 2013/03/06
- [Qemu-devel] [PATCH 08/12] target-lm32: remove dead code, Michael Walle, 2013/03/06
- [Qemu-devel] [PATCH 06/12] tests: tcg: lm32: add more test cases, Michael Walle, 2013/03/06
- [Qemu-devel] [PATCH 12/12] configure: rename OpenGL feature to GLX, Michael Walle, 2013/03/06
- [Qemu-devel] [PATCH 11/12] configure: proper OpenGL/GLX probe, Michael Walle, 2013/03/06
- [Qemu-devel] [PATCH 07/12] target-lm32: fix cmpgui and cmpgeui opcodes, Michael Walle, 2013/03/06