bsdiff: Add patches for CVEs

Add two patches from Debian fixing CVEs in the bsdiff application.
CVE-2014-9862: Heap vulnerability in bspatch
CVE-2020-14315: Memory Corruption Vulnerability in bspatch

Copied the patches from this location:
https://salsa.debian.org/debian/bsdiff/-/blob/debian/latest/debian/patches/20-CVE-2014-9862.patch
https://salsa.debian.org/debian/bsdiff/-/blob/debian/latest/debian/patches/33-CVE-2020-14315.patch

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit cac723e8b8748938b8d80603578c60189fc32b24)
This commit is contained in:
Hauke Mehrtens
2023-10-07 21:07:20 +02:00
parent fadbec8857
commit 6637af95aa
4 changed files with 433 additions and 13 deletions

View File

@@ -1,6 +1,6 @@
--- a/bsdiff.c 2005-08-17 00:13:52.000000000 +0200
+++ b/bsdiff.c 2016-02-21 01:39:31.157915765 +0100
@@ -101,7 +101,7 @@
--- a/bsdiff.c
+++ b/bsdiff.c
@@ -101,7 +101,7 @@ static void split(off_t *I,off_t *V,off_
if(start+len>kk) split(I,V,kk,start+len-kk,h);
}
@@ -9,7 +9,7 @@
{
off_t buckets[256];
off_t i,h,len;
@@ -139,7 +139,7 @@
@@ -139,7 +139,7 @@ static void qsufsort(off_t *I,off_t *V,u
for(i=0;i<oldsize+1;i++) I[V[i]]=i;
}
@@ -18,7 +18,7 @@
{
off_t i;
@@ -149,8 +149,8 @@
@@ -149,8 +149,8 @@ static off_t matchlen(u_char *old,off_t
return i;
}
@@ -29,7 +29,7 @@
{
off_t x,y;
@@ -175,7 +175,7 @@
@@ -175,7 +175,7 @@ static off_t search(off_t *I,u_char *old
};
}
@@ -38,7 +38,7 @@
{
off_t y;
@@ -196,7 +196,7 @@
@@ -196,7 +196,7 @@ static void offtout(off_t x,u_char *buf)
int main(int argc,char *argv[])
{
int fd;
@@ -47,7 +47,7 @@
off_t oldsize,newsize;
off_t *I,*V;
off_t scan,pos,len;
@@ -206,9 +206,9 @@
@@ -206,9 +206,9 @@ int main(int argc,char *argv[])
off_t overlap,Ss,lens;
off_t i;
off_t dblen,eblen;
@@ -60,9 +60,9 @@
FILE * pf;
BZFILE * pfbz2;
int bz2err;
--- a/bspatch.c 2005-08-17 00:14:00.000000000 +0200
+++ b/bspatch.c 2016-02-21 01:39:29.753859970 +0100
@@ -36,7 +36,7 @@
--- a/bspatch.c
+++ b/bspatch.c
@@ -36,7 +36,7 @@ __FBSDID("$FreeBSD: src/usr.bin/bsdiff/b
#include <unistd.h>
#include <fcntl.h>
@@ -71,7 +71,7 @@
{
off_t y;
@@ -62,8 +62,8 @@
@@ -62,8 +62,8 @@ int main(int argc,char * argv[])
int fd;
ssize_t oldsize,newsize;
ssize_t bzctrllen,bzdatalen;