From 18285ca7515475b020b20c217f79d91254106e2d Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Wed, 23 Jan 2013 14:05:35 -0500 Subject: [PATCH] Fixed potential for reading out of library bounds in MemoryUtils;:FindPattern (r=asherkin). --- core/logic/MemoryUtils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/logic/MemoryUtils.cpp b/core/logic/MemoryUtils.cpp index e48c2489..151ede1b 100644 --- a/core/logic/MemoryUtils.cpp +++ b/core/logic/MemoryUtils.cpp @@ -116,7 +116,7 @@ void *MemoryUtils::FindPattern(const void *libPtr, const char *pattern, size_t l } ptr = reinterpret_cast(lib.baseAddress); - end = ptr + lib.memorySize - 1; + end = ptr + lib.memorySize - len; while (ptr < end) {