Browse code

libclamav: pulled autoit patch from master branch

David Raynor authored on 2013/03/12 05:07:29
Showing 2 changed files
... ...
@@ -154,6 +154,10 @@ Mon Jul 25 14:33:59 CEST 2011 (acab)
154 154
 ------------------------------------
155 155
  * libclamav/matcher-hash.c: off by one read in cli_hm_scan (bb#2818)
156 156
 
157
+Tue Jul 19 18:30:53 CEST 2011 (acab)
158
+------------------------------------
159
+ * libclamav/autoit.c: avoid dumping uninit data on autoit failure (bb#3051)
160
+
157 161
 Thu Jul 14 12:29:17 EEST 2011 (edwin)
158 162
 ------------------------------------
159 163
  * libclamav/pdf.c: fix encrypted pdf detection (bb #2988)
... ...
@@ -339,14 +339,22 @@ static int ea05(cli_ctx *ctx, uint8_t *base, char *tmpd) {
339 339
        *
340 340
        * - Fortuna audaces iuvat -
341 341
        */
342
-      if (UNP.error) 
343
-	cli_dbgmsg("autoit: decompression error - partial file may exist\n");
342
+      if (UNP.error) {
343
+	cli_dbgmsg("autoit: decompression error after %u bytes  - partial file may exist\n", UNP.cur_output);
344
+	UNP.usize = UNP.cur_output;
345
+      }
344 346
     } else {
345 347
       cli_dbgmsg("autoit: file is not compressed\n");
346 348
       UNP.outputbuf = UNP.inputbuf;
347 349
       UNP.usize = UNP.csize;
348 350
     }
349 351
 
352
+    if (UNP.usize<4) {
353
+      cli_dbgmsg("autoit: file is too short\n");
354
+      free(UNP.outputbuf);
355
+      continue;
356
+    }
357
+
350 358
     files++;
351 359
 
352 360
     /* FIXME: REGRESSION NEEDED! */
... ...
@@ -638,8 +646,10 @@ static int ea06(cli_ctx *ctx, uint8_t *base, char *tmpd) {
638 638
       }
639 639
 
640 640
       free(UNP.inputbuf);
641
-      if (UNP.error) 
642
-	cli_dbgmsg("autoit: decompression error - partial file may exist\n");
641
+      if (UNP.error) {
642
+	cli_dbgmsg("autoit: decompression error after %u bytes - partial file may exist\n", UNP.cur_output);
643
+	UNP.usize = UNP.cur_output;
644
+      }
643 645
     } else {
644 646
       cli_dbgmsg("autoit: file is not compressed\n");
645 647
       UNP.outputbuf = UNP.inputbuf;