Browse code

fix heap check in packlibs

git-svn: trunk@2722

aCaB authored on 2007/02/13 06:12:17
Showing 2 changed files
... ...
@@ -1,3 +1,6 @@
1
+Mon Feb 12 22:08:15 CET 2007 (acab)
2
+  * libclamav/packlibs: fix possible heap overflow (thanks Edvin)
3
+
1 4
 Mon Feb 12 21:59:49 CET 2007 (tk)
2 5
 ---------------------------------
3 6
   * change some URLs to comply with the new website, thanks to Luca
... ...
@@ -51,7 +51,7 @@ int cli_unfsg(char *source, char *dest, int ssize, int dsize, char **endsrc, cha
51 51
   char *csrc = source, *cdst = dest;
52 52
   int oob, lostbit = 1;
53 53
 
54
-  /* I assume buffers size is >0 - No checking! */
54
+  if (ssize<=0 || dsize<=0) return -1;
55 55
   *cdst++=*csrc++;
56 56
 
57 57
   while ( 1 ) {