summaryrefslogtreecommitdiffstats
path: root/usr.bin/bsdiff/bspatch/bspatch.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-07-26 10:02:58 -0300
committerRenato Botelho <renato@netgate.com>2016-07-26 10:02:58 -0300
commit4008e6a2e9bc1ee9983a4cf7d23093d2015026d6 (patch)
tree571be021b9c4ba8d76b5527ff7029dba6d607bba /usr.bin/bsdiff/bspatch/bspatch.c
parenta3c20a378f7a9fa76e9301a43ac64ed07057d01e (diff)
parentc9c19c9c8410b1dcbd760d5382a6071ed8396652 (diff)
downloadFreeBSD-src-4008e6a2e9bc1ee9983a4cf7d23093d2015026d6.zip
FreeBSD-src-4008e6a2e9bc1ee9983a4cf7d23093d2015026d6.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
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