aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/bsdiff/bspatch/bspatch.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2016-07-25 14:45:48 +0000
committerXin LI <delphij@FreeBSD.org>2016-07-25 14:45:48 +0000
commit2c8d04d0228871c24017509cf039e7c5d97d97be (patch)
tree89ec92d2e3860a4bcfdd207059d425dd7cde0980 /usr.bin/bsdiff/bspatch/bspatch.c
parentae1b731b5df08932444f7526e111a9ebdd0ed584 (diff)
Notes
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 eb99e5ba16a0..5d6141259f72 100644
--- a/usr.bin/bsdiff/bspatch/bspatch.c
+++ b/usr.bin/bsdiff/bspatch/bspatch.c
@@ -164,6 +164,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");