From 94074a84d0907f7151b7f274606fcbcf1a248fd5 Mon Sep 17 00:00:00 2001 From: "cdn@chromium.org" Date: Thu, 12 May 2011 19:11:26 +0000 Subject: Fix null derefs in x86 dissasembler code. BUG=428 TEST=N/A Review URL: http://breakpad.appspot.com/285001 git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@789 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/processor/disassembler_x86.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/processor') diff --git a/src/processor/disassembler_x86.cc b/src/processor/disassembler_x86.cc index 76015f4a..7e41e4bf 100644 --- a/src/processor/disassembler_x86.cc +++ b/src/processor/disassembler_x86.cc @@ -174,7 +174,7 @@ u_int32_t DisassemblerX86::NextInstruction() { switch (current_instr_.type) { case libdis::insn_xor: if (src && src->type == libdis::op_register && - dest->type == libdis::op_register && + dest && dest->type == libdis::op_register && src->data.reg.id == bad_register_.id && src->data.reg.id == dest->data.reg.id) register_valid_ = false; @@ -192,7 +192,7 @@ u_int32_t DisassemblerX86::NextInstruction() { case libdis::insn_xchg: case libdis::insn_xchgcc: if (dest && dest->type == libdis::op_register && - src->type == libdis::op_register) { + src && src->type == libdis::op_register) { if (dest->data.reg.id == bad_register_.id) memcpy(&bad_register_, &src->data.reg, sizeof(libdis::x86_reg_t)); else if (src->data.reg.id == bad_register_.id) -- cgit v1.2.1