summaryrefslogtreecommitdiffstats
path: root/usr.bin/bsdiff/bspatch/bspatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/bsdiff/bspatch/bspatch.c')
-rw-r--r--usr.bin/bsdiff/bspatch/bspatch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/usr.bin/bsdiff/bspatch/bspatch.c b/usr.bin/bsdiff/bspatch/bspatch.c
index d2af3ca..92bc75b 100644
--- a/usr.bin/bsdiff/bspatch/bspatch.c
+++ b/usr.bin/bsdiff/bspatch/bspatch.c
@@ -155,6 +155,10 @@ int main(int argc,char * argv[])
};
/* Sanity-check */
+ if ((ctrl[0] < 0) || (ctrl[1] < 0))
+ errx(1,"Corrupt patch\n");
+
+ /* Sanity-check */
if(newpos+ctrl[0]>newsize)
errx(1,"Corrupt patch\n");
OpenPOWER on IntegriCloud