[Forensics-changes] [yara] 143/407: Fix bug where array length was off by one.
Hilko Bengen
bengen at moszumanska.debian.org
Sat Jul 1 10:28:19 UTC 2017
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag v3.3.0
in repository yara.
commit fe83cf1065b3cbb0ea462b280f0a7c58adefb6e3
Author: Wesley Shields <wxs at atarininja.org>
Date: Wed Oct 22 23:36:24 2014 -0400
Fix bug where array length was off by one.
This fixes the bug mentioned in 4be90889d3cc5d283803aa155c5ca8f0f5de58e1.
I was incorrectly recording the signature_length as one more than it really
was. Fix it by decrementing the counter before setting it.
---
libyara/modules/pe.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libyara/modules/pe.c b/libyara/modules/pe.c
index 7ac8cdc..e0a00ad 100644
--- a/libyara/modules/pe.c
+++ b/libyara/modules/pe.c
@@ -2497,6 +2497,8 @@ void pe_parse_certificates(
cert_bio = NULL;
}
+ // Decrement counter as it gets incremented one extra time erroneously.
+ counter--;
set_integer(counter, pe->object, "signature_length");
return;
}
--
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