Added null checks to disassembler_x86

Review URL: http://breakpad.appspot.com/239001

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@736 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
cdn@chromium.org 2010-12-03 22:28:58 +00:00
parent 30b075c4a5
commit fb7fdb9426

View file

@ -212,7 +212,7 @@ bool DisassemblerX86::setBadRead() {
return false;
libdis::x86_op_t *operand = libdis::x86_get_src_operand(&current_instr_);
if (operand->type != libdis::op_expression)
if (!operand || operand->type != libdis::op_expression)
return false;
memcpy(&bad_register_, &operand->data.expression.base,
@ -226,7 +226,7 @@ bool DisassemblerX86::setBadWrite() {
return false;
libdis::x86_op_t *operand = libdis::x86_get_dest_operand(&current_instr_);
if (operand->type != libdis::op_expression)
if (!operand || operand->type != libdis::op_expression)
return false;
memcpy(&bad_register_, &operand->data.expression.base,