summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2016-07-25 14:53:04 +0000
committerdelphij <delphij@FreeBSD.org>2016-07-25 14:53:04 +0000
commite9e84b258534867ada8546cd53545ae93c94c5cf (patch)
tree8595a281d09089aa543a21d10f18330d4ad559b6 /usr.bin
parenta2304bc0db6fb1f2212a5c75eb1f696ff541a00b (diff)
downloadFreeBSD-src-e9e84b258534867ada8546cd53545ae93c94c5cf.zip
FreeBSD-src-e9e84b258534867ada8546cd53545ae93c94c5cf.tar.gz
Fix bspatch heap overflow vulnerability.
Obtained from: Chromium Reported by: Lu Tung-Pin Security: FreeBSD-SA-16:25.bspatch
Diffstat (limited to 'usr.bin')
-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