Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: courgette/disassembler_win32_x86.cc

Issue 8501023: Fix two pointer arithmetic errors. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: courgette/disassembler_win32_x86.cc
diff --git a/courgette/disassembler_win32_x86.cc b/courgette/disassembler_win32_x86.cc
index 39cb695225fe8919fe746f4d3002411e4655ed1c..affd0f9931cd8ec782e2c62f9151f47f5a3b138b 100644
--- a/courgette/disassembler_win32_x86.cc
+++ b/courgette/disassembler_win32_x86.cc
@@ -466,7 +466,7 @@ void DisassemblerWin32X86::ParseRel32RelocsFromSection(const Section* section) {
// addressing mode?
const uint8* rel32 = NULL;
- if (p + 5 < end_pointer) {
+ if (p + 5 <= end_pointer) {
if (*p == 0xE8 || *p == 0xE9) { // jmp rel32 and call rel32
rel32 = p + 1;
}
@@ -503,7 +503,7 @@ void DisassemblerWin32X86::ParseRel32RelocsFromSection(const Section* section) {
#if COURGETTE_HISTOGRAM_TARGETS
++rel32_target_rvas_[target_rva];
#endif
- p += 4;
+ p = rel32 + 4;
continue;
}
}
« courgette/disassembler_elf_32_x86.cc ('K') | « courgette/disassembler_elf_32_x86_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698