[Forensics-changes] [yara] 303/368: Fix dead code warning in Coverity

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:50 UTC 2017


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

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

commit c4e2a57dd596ca3b8d688056d5fdf151f4c8635d
Author: plusvic <plusvic at gmail.com>
Date:   Mon Jun 6 23:22:09 2016 +0200

    Fix dead code warning in Coverity
---
 libyara/lexer.c | 8 ++++++++
 libyara/lexer.l | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/libyara/lexer.c b/libyara/lexer.c
index 6a0ffc7..77ca8ac 100644
--- a/libyara/lexer.c
+++ b/libyara/lexer.c
@@ -1393,9 +1393,17 @@ YY_RULE_SETUP
     b = strrchr(buffer, '\\'); // in Windows both path delimiters are accepted
     #endif
 
+    #ifdef _WIN32
     if (s != NULL || b != NULL)
+    #else
+    if (s != NULL)
+    #endif
     {
+      #ifdef _WIN32
       f = (b > s)? (b + 1): (s + 1);
+      #else
+      f = s + 1;
+      #endif
 
       strlcpy(f, yyextra->lex_buf, sizeof(buffer) - (f - buffer));
 
diff --git a/libyara/lexer.l b/libyara/lexer.l
index 925906c..87753c9 100644
--- a/libyara/lexer.l
+++ b/libyara/lexer.l
@@ -198,9 +198,17 @@ include[ \t]+\"         {
     b = strrchr(buffer, '\\'); // in Windows both path delimiters are accepted
     #endif
 
+    #ifdef _WIN32
     if (s != NULL || b != NULL)
+    #else
+    if (s != NULL)
+    #endif
     {
+      #ifdef _WIN32
       f = (b > s)? (b + 1): (s + 1);
+      #else
+      f = s + 1;
+      #endif
 
       strlcpy(f, yyextra->lex_buf, sizeof(buffer) - (f - buffer));
 

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