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
This commit is contained in:
cdn@chromium.org 2011-05-12 19:11:26 +00:00
parent 1807e385d7
commit 94074a84d0

View file

@ -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)