[Forensics-changes] [yara] 234/415: Add missing bound check and increase stack size
Hilko Bengen
bengen at moszumanska.debian.org
Thu Apr 3 05:43:09 UTC 2014
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to branch debian
in repository yara.
commit 533a62180d3c8b214baf5f8edb5c06f6304322c8
Author: Victor M. Alvarez <plusvic at gmail.com>
Date: Thu Nov 21 13:13:01 2013 +0000
Add missing bound check and increase stack size
---
libyara/rules.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/libyara/rules.c b/libyara/rules.c
index c2dfd00..f21d8a6 100644
--- a/libyara/rules.c
+++ b/libyara/rules.c
@@ -133,7 +133,7 @@ inline int _yr_scan_wicompare(
}
-#define MAX_FAST_HEX_RE_STACK 100
+#define MAX_FAST_HEX_RE_STACK 200
int _yr_scan_fast_hex_re_exec(
@@ -229,9 +229,17 @@ int _yr_scan_fast_hex_re_exec(
for (i = *(uint16_t*)(ip + 1); i > 0; i--)
{
if (flags & RE_FLAGS_BACKWARDS)
+ {
next_input = current_input - i;
+ if (next_input <= input - input_size)
+ continue;
+ }
else
+ {
next_input = current_input + i;
+ if (next_input >= input + input_size)
+ continue;
+ }
if ( *(ip + 11) != RE_OPCODE_LITERAL ||
(*(ip + 11) == RE_OPCODE_LITERAL &&
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git
More information about the forensics-changes
mailing list