From 3682b31cbe43700d654dcc85cddd206615ddc449 Mon Sep 17 00:00:00 2001 From: "mark@chromium.org" Date: Mon, 17 Sep 2012 21:55:37 +0000 Subject: [PATCH] Change an always true comparison to another conditional. Since next_offset is unsigned, comparing it >= 0 is always true. Instead, compare the numbers whose difference makes next_offset. Patch by Richard Trieu. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@1040 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/third_party/libdisasm/x86_disasm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/third_party/libdisasm/x86_disasm.c b/src/third_party/libdisasm/x86_disasm.c index 04574fa0..d6b7f810 100644 --- a/src/third_party/libdisasm/x86_disasm.c +++ b/src/third_party/libdisasm/x86_disasm.c @@ -165,7 +165,7 @@ unsigned int x86_disasm_forward( unsigned char *buf, unsigned int buf_len, if (next_addr != -1 ) { next_offset = next_addr - buf_rva; /* if offset is in this buffer... */ - if ( next_offset >= 0 && + if ( next_addr >= buf_rva && next_offset < buf_len ) { /* go ahead and disassemble */ count += x86_disasm_forward( buf,