[Forensics-changes] [yara] 89/192: Make sure that loop depth is greater than 0 before decrementing it.

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:31:51 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.6.0
in repository yara.

commit 7f02eca670f29c00a1d2c305e96febae6ce5d37b
Author: plusvic <plusvic at gmail.com>
Date:   Mon Jan 9 13:17:39 2017 +0100

    Make sure that loop depth is greater than 0 before decrementing it.
---
 libyara/grammar.y | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libyara/grammar.y b/libyara/grammar.y
index 446d374..bf3c88b 100644
--- a/libyara/grammar.y
+++ b/libyara/grammar.y
@@ -1017,8 +1017,11 @@ expression
       }
     | _FOR_ for_expression error
       {
-        compiler->loop_depth--;
-        compiler->loop_identifier[compiler->loop_depth] = NULL;
+        if (compiler->loop_depth > 0)
+        {
+          compiler->loop_depth--;
+          compiler->loop_identifier[compiler->loop_depth] = NULL;
+        }
       }
     | _FOR_ for_expression _IDENTIFIER_ _IN_
       {

-- 
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