[Forensics-changes] [yara] 36/160: Initialize new_match->chain_length
Hilko Bengen
bengen at moszumanska.debian.org
Sat Jul 1 10:29:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag v3.4.0
in repository yara.
commit e654c4039ec3e4248b744735f6e5f4a0a2729c33
Author: Victor M. Alvarez <plusvic at gmail.com>
Date: Wed Mar 11 13:39:11 2015 +0100
Initialize new_match->chain_length
Because of the change introduced in commit 8b7eb764e70e8e45de4e935ccb620965c5a33b9e chain_length must be initialised to avoid a comparison with random value.
---
libyara/scan.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libyara/scan.c b/libyara/scan.c
index db7fe87..1fbc46e 100644
--- a/libyara/scan.c
+++ b/libyara/scan.c
@@ -329,10 +329,12 @@ void _yr_scan_update_match_chain_length(
if (match_to_update->chain_length == chain_length)
return;
+
match_to_update->chain_length = chain_length;
if (string->chained_to == NULL)
return;
+
match = string->chained_to->unconfirmed_matches[tidx].head;
while (match != NULL)
@@ -542,6 +544,7 @@ int _yr_scan_verify_chained_string_match(
new_match->offset = match_offset;
new_match->length = match_length;
new_match->data = match_data;
+ new_match->chain_length = 0;
new_match->prev = NULL;
new_match->next = NULL;
--
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