[Forensics-changes] [yara] 16/160: Don't try to memset() the allocated memory, if the allocation failed.

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:29:13 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 3f91011e6c735ed3b537771b9a42cfa8d81e39ef
Author: Olivier Houchard <ohouchard at qualys.com>
Date:   Fri Feb 13 15:50:49 2015 +0100

    Don't try to memset() the allocated memory, if the allocation failed.
---
 libyara/arena.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libyara/arena.c b/libyara/arena.c
index 2d461d6..01b7e7e 100644
--- a/libyara/arena.c
+++ b/libyara/arena.c
@@ -636,7 +636,8 @@ int yr_arena_allocate_struct(
 
   va_end(offsets);
 
-  memset(*allocated_memory, 0, size);
+  if (result == ERROR_SUCCESS)
+    memset(*allocated_memory, 0, size);
 
   return result;
 }

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