Browse code

fix possible crash

git-svn: trunk@1633

Tomasz Kojm authored on 2005/06/24 21:30:46
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Thu Jun 23 22:52:43 CEST 2005 (tk)
2
+----------------------------------
3
+  * libclamav/mspack/qtmd.c: fix possible crash
4
+
1 5
 Thu Jun 23 15:49:10 CEST 2005 (tk)
2 6
 ----------------------------------
3 7
   * clamd: revert the queue limit patch
... ...
@@ -250,7 +250,9 @@ struct qtmd_stream *qtmd_init(struct mspack_system *system,
250 250
   if (!system) return NULL;
251 251
 
252 252
   /* Quantum supports window sizes of 2^10 (1Kb) through 2^21 (2Mb) */
253
-  if (window_bits < 10 || window_bits > 21) return NULL;
253
+
254
+  /* tk: temporary fix: only process 32KB+ window sizes */
255
+  if (window_bits < 15 || window_bits > 21) return NULL;
254 256
 
255 257
   input_buffer_size = (input_buffer_size + 1) & -2;
256 258
   if (input_buffer_size < 2) return NULL;