[Forensics-changes] [yara] 278/368: Fix warnings while building in Windows

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:47 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 eff84ea40a4d8f0f5121ab4f81d555bc7b116f65
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Mon May 16 12:31:58 2016 +0200

    Fix warnings while building in Windows
---
 libyara/ahocorasick.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/libyara/ahocorasick.c b/libyara/ahocorasick.c
index 42e0214..453fdc3 100644
--- a/libyara/ahocorasick.c
+++ b/libyara/ahocorasick.c
@@ -461,8 +461,11 @@ int _yr_ac_find_suitable_transition_table_slot(
       size_t t_bytes_size = automaton->tables_size * sizeof(YR_AC_TRANSITION);
       size_t m_bytes_size = automaton->tables_size * sizeof(YR_AC_MATCH*);
 
-      automaton->t_table = yr_realloc(automaton->t_table, t_bytes_size * 2);
-      automaton->m_table = yr_realloc(automaton->m_table, m_bytes_size * 2);
+      automaton->t_table = (YR_AC_TRANSITION_TABLE) yr_realloc(
+          automaton->t_table, t_bytes_size * 2);
+      
+	  automaton->m_table = (YR_AC_MATCH_TABLE) yr_realloc(
+          automaton->m_table, m_bytes_size * 2);
 
       if (automaton->t_table == NULL || automaton->m_table == NULL)
         return ERROR_INSUFICIENT_MEMORY;
@@ -575,10 +578,10 @@ int _yr_ac_build_transition_table(
 
   automaton->tables_size = 1024;
 
-  automaton->t_table = yr_malloc(
+  automaton->t_table = (YR_AC_TRANSITION_TABLE) yr_malloc(
       automaton->tables_size * sizeof(YR_AC_TRANSITION));
 
-  automaton->m_table = yr_malloc(
+  automaton->m_table = (YR_AC_MATCH_TABLE) yr_malloc(
       automaton->tables_size * sizeof(YR_AC_MATCH*));
 
   if (automaton->t_table == NULL || automaton->t_table == NULL)
@@ -748,8 +751,8 @@ int yr_ac_automaton_create(
   YR_AC_AUTOMATON* new_automaton;
   YR_AC_STATE* root_state;
 
-  new_automaton = yr_malloc(sizeof(YR_AC_AUTOMATON));
-  root_state = yr_malloc(sizeof(YR_AC_STATE));
+  new_automaton = (YR_AC_AUTOMATON*) yr_malloc(sizeof(YR_AC_AUTOMATON));
+  root_state = (YR_AC_STATE*) yr_malloc(sizeof(YR_AC_STATE));
 
   if (new_automaton == NULL || root_state == 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