Browse code

libclamav/ole2_extract.c, sigtool: make sigtool compatible with the new OLE2 scan scheme (bb#1086)

git-svn: trunk@3915

Tomasz Kojm authored on 2008/07/07 23:10:15
Showing 4 changed files
... ...
@@ -1,3 +1,8 @@
1
+Mon Jul  7 15:41:02 CEST 2008 (tk)
2
+----------------------------------
3
+  * libclamav/ole2_extract.c, sigtool: make sigtool compatible with the new
4
+				       OLE2 scan scheme (bb#1086)
5
+
1 6
 Fri Jul  4 18:04:40 CEST 2008 (tk)
2 7
 ----------------------------------
3 8
   * configure, clamd: fix compilation error on systems without
... ...
@@ -1063,7 +1063,8 @@ int cli_ole2_extract(int fd, const char *dirname, cli_ctx *ctx, struct uniq **vb
1063 1063
 	  cli_dbgmsg("OLE2: no VBA projects found\n");
1064 1064
 	  /* PASS 2/B : OTF scan */
1065 1065
 	  file_count = 0;
1066
-	  ret = ole2_walk_property_tree(fd, &hdr, NULL, 0, handler_otf, 0, &file_count, ctx, &scansize2);
1066
+	  if(ctx)
1067
+	    ret = ole2_walk_property_tree(fd, &hdr, NULL, 0, handler_otf, 0, &file_count, ctx, &scansize2);
1067 1068
 	}
1068 1069
 
1069 1070
 abort:
... ...
@@ -1178,7 +1178,7 @@ static int vbadump(struct optstruct *opt)
1178 1178
 	int fd, hex_output;
1179 1179
 	char *dir;
1180 1180
 	const char *pt;
1181
-	struct uniq *vba;
1181
+	struct uniq *vba = NULL;
1182 1182
 
1183 1183
 
1184 1184
     if(opt_check(opt, "vba-hex")) {
... ...
@@ -983,7 +983,7 @@ static int sigtool_scandir (const char *dirname, int hex_output)
983 983
 			    }
984 984
 			} else {
985 985
 			    if (S_ISREG (statbuf.st_mode)) {
986
-			        struct uniq *vba;
986
+			        struct uniq *vba = NULL;
987 987
 				tmpdir = getenv ("TMPDIR");
988 988
 
989 989
 				if (tmpdir == NULL)
... ...
@@ -1012,7 +1012,8 @@ static int sigtool_scandir (const char *dirname, int hex_output)
1012 1012
 				    return ret;
1013 1013
 				}
1014 1014
 
1015
-				sigtool_vba_scandir (dir, hex_output, vba);
1015
+				if(vba)
1016
+				    sigtool_vba_scandir (dir, hex_output, vba);
1016 1017
 
1017 1018
 				cli_rmdirs (dir);
1018 1019
 				free (dir);