Skip to content

Commit bce74f2

Browse files
drake127icedream
authored andcommitted
1 parent 02967bb commit bce74f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

bsdiff/bspatch.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ int bspatch(const uint8_t* old, int64_t oldsize, uint8_t* new, int64_t newsize,
6262
};
6363

6464
/* Sanity-check */
65-
if(newpos+ctrl[0]>newsize)
65+
if (ctrl[0]<0 || ctrl[0]>INT_MAX ||
66+
ctrl[1]<0 || ctrl[1]>INT_MAX ||
67+
newpos+ctrl[0]>newsize)
6668
return -1;
6769

6870
/* Read diff string */

0 commit comments

Comments
 (0)