Browse code

fix possible infinite loop introduced in r3717 (bb#899)

git-svn: trunk@3754

Tomasz Kojm authored on 2008/04/03 21:35:13
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Apr  3 13:52:19 CEST 2008 (tk)
2
+----------------------------------
3
+  * libclamav/mspack.c: fix possible infinite loop introduced in r3717 (bb#899)
4
+
1 5
 Wed Apr  2 22:54:23 CEST 2008 (tk)
2 6
 ----------------------------------
3 7
   * libclamav/scanners.c: cl_scandesc: check if limits is not null (bb#907)
... ...
@@ -104,7 +104,7 @@ static const unsigned short mszip_bit_mask_tab[17] = {
104 104
       if (mszip_read_input(zip)) return zip->error;                      \
105 105
       i_ptr = zip->i_ptr;                                               \
106 106
       i_end = zip->i_end;                                               \
107
-      if(i_ptr == i_end) break;						\
107
+      if(i_ptr == i_end) return CL_EFORMAT;				\
108 108
     }                                                                   \
109 109
     bit_buffer |= *i_ptr++ << bits_left; bits_left  += 8;               \
110 110
   }                                                                     \