[Forensics-changes] [yara] 76/135: Fix warning about uninitialised variable and add assert

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:27:34 UTC 2017


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

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

commit 285d5383df32a0d07ca9b2b8ea05981469316fbe
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Thu Jul 24 13:37:58 2014 +0200

    Fix warning about uninitialised variable and add assert
---
 libyara/object.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libyara/object.c b/libyara/object.c
index 7ec64c6..69173a0 100644
--- a/libyara/object.c
+++ b/libyara/object.c
@@ -181,8 +181,8 @@ int yr_object_from_external_variable(
     YR_OBJECT** object)
 {
   YR_OBJECT* obj;
-  uint8_t obj_type;
   int result;
+  uint8_t obj_type = 0;
 
   switch(external->type)
   {
@@ -195,6 +195,9 @@ int yr_object_from_external_variable(
     case EXTERNAL_VARIABLE_TYPE_MALLOC_STRING:
       obj_type = OBJECT_TYPE_STRING;
       break;
+
+    default:
+      assert(FALSE);
   }
 
   result = yr_object_create(

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