]> Git Repo - qemu.git/commitdiff
lm32-dis: fix NULL pointer dereference
authorMichael Walle <[email protected]>
Mon, 16 Jul 2012 17:05:59 +0000 (19:05 +0200)
committerMichael Walle <[email protected]>
Mon, 18 Mar 2013 18:40:34 +0000 (19:40 +0100)
Signed-off-by: Michael Walle <[email protected]>
disas/lm32.c

index a8eefe05b182104af6ef2b4cb510476a82150f8d..1718c86e1c0ff02abb1784e0308183d313708db3 100644 (file)
@@ -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);
                     }
This page took 0.028655 seconds and 4 git commands to generate.