Browse code

Fixed some wraps.

git-svn: trunk@1652

aCaB authored on 2005/07/19 17:10:43
Showing 2 changed files
... ...
@@ -1,3 +1,7 @@
1
+Tue Jul 19 09:55:52 CEST 2005 (acab)
2
+------------------------------------
3
+  * libclamav/fsg.c:    Fix possible integer overflow. Reported by Alex Wheeler.
4
+
1 5
 Sat Jul 16 16:52:17 BST 2005 (njh)
2 6
 ----------------------------------
3 7
   * libclamav/mbox.c:	Fix name clash with glibc library, reported by
... ...
@@ -186,7 +186,7 @@ static int unfsg(char *source, char *dest, int ssize, int dsize, char **endsrc,
186 186
 	}
187 187
 	lostbit = 0;
188 188
       }
189
-      if (cdst-backbytes < dest || cdst+backsize >= dest+dsize)
189
+      if ((backsize >= dest + dsize - cdst) || (backbytes > cdst - dest))
190 190
 	return -1;
191 191
       while(backsize--) {
192 192
 	*cdst=*(cdst-backbytes);