[Forensics-changes] [yara] 317/368: Explicit initialization of pointer to avoid Coverity complaining

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:52 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 66c5b3be8ab479aa65bb429739a4b05f6174fd7a
Author: plusvic <plusvic at gmail.com>
Date:   Wed Jun 15 12:21:20 2016 +0200

    Explicit initialization of pointer to avoid Coverity complaining
---
 libyara/proc.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libyara/proc.c b/libyara/proc.c
index 451ae23..549acf9 100644
--- a/libyara/proc.c
+++ b/libyara/proc.c
@@ -85,6 +85,8 @@ int _yr_process_get_blocks(
   GetSystemInfo(&si);
   address = si.lpMinimumApplicationAddress;
 
+  *head = NULL;
+
   while (address < si.lpMaximumApplicationAddress &&
     VirtualQueryEx(hProcess, address, &mbi, sizeof(mbi)) != 0)
   {
@@ -243,6 +245,8 @@ int _yr_process_get_blocks(
   YR_MEMORY_BLOCK* new_block;
   YR_MEMORY_BLOCK* current = NULL;
 
+  *head = NULL;
+
   do
   {
     info_count = VM_REGION_BASIC_INFO_COUNT_64;
@@ -412,7 +416,9 @@ int _yr_process_get_blocks(
   YR_MEMORY_BLOCK* new_block;
   YR_MEMORY_BLOCK* current = NULL;
 
-  YR_PTRACE_CONTEXT* ctx = (YR_PTRACE_CONTEXT*)context;
+  YR_PTRACE_CONTEXT* ctx = (YR_PTRACE_CONTEXT*) context;
+
+  *head = NULL;
 
   while (fgets(buffer, sizeof(buffer), ctx->maps) != 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