summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorViktor Drobot2023-06-06 22:12:41 +0300
committerViktor Drobot2023-06-06 22:12:41 +0300
commit5aa9251336977827168ec3d4d79ddc6c1055583d (patch)
treeeaee0e81394a660ac1be5a643b06a8de12636e14
downloadaur-5aa9251336977827168ec3d4d79ddc6c1055583d.tar.gz
Resurrect from the dead
-rw-r--r--.SRCINFO16
-rw-r--r--CVE-2014-9862.patch16
-rw-r--r--PKGBUILD36
3 files changed, 68 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..2ca8c740428e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = bsdiff
+ pkgdesc = Tool for programming serial SPI FlashROM memories attached to PC via parallel port cable
+ pkgver = 4.3
+ pkgrel = 1
+ url = https://www.daemonology.net/bsdiff/
+ arch = i686
+ arch = x86_64
+ license = custom
+ makedepends = patch
+ depends = bzip2
+ source = https://ftp.desolve.ru/pub/bsdiff/bsdiff-4.3.tar.gz
+ source = CVE-2014-9862.patch
+ sha256sums = 18821588b2dc5bf159aa37d3bcb7b885d85ffd1e19f23a0c57a58723fea85f48
+ sha256sums = 3f50f832eff04a00d59bd7fe19fd743b5639ea7cc78822329a77604f28e24102
+
+pkgname = bsdiff
diff --git a/CVE-2014-9862.patch b/CVE-2014-9862.patch
new file mode 100644
index 000000000000..d215534a0906
--- /dev/null
+++ b/CVE-2014-9862.patch
@@ -0,0 +1,16 @@
+--- bspatch.c 2005-08-17 02:14:00.000000000 +0400
++++ bspatch.c.new 2023-06-06 22:03:24.563865659 +0300
+@@ -150,10 +150,13 @@
+ errx(1, "Corrupt patch\n");
+ ctrl[i]=offtin(buf);
+ };
+
+ /* Sanity-check */
++ if ((ctrl[0] < 0) || (ctrl[1] < 0))
++ errx(1,"Corrupt patch\n");
++
+ if(newpos+ctrl[0]>newsize)
+ errx(1,"Corrupt patch\n");
+
+ /* Read diff string */
+ lenread = BZ2_bzRead(&dbz2err, dpfbz2, new + newpos, ctrl[0]);
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..3fed6f5de445
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,36 @@
+# Maintainer: Viktor Drobot (aka dviktor) linux776 [at] gmail [dot] com
+
+pkgname=bsdiff
+pkgver=4.3
+pkgrel=1
+pkgdesc="Tool for programming serial SPI FlashROM memories attached to PC via parallel port cable"
+arch=(i686 x86_64)
+url="https://www.daemonology.net/bsdiff/"
+license=(custom)
+depends=(bzip2)
+makedepends=(patch)
+source=("https://ftp.desolve.ru/pub/bsdiff/${pkgname}-${pkgver}.tar.gz"
+ "CVE-2014-9862.patch")
+sha256sums=('18821588b2dc5bf159aa37d3bcb7b885d85ffd1e19f23a0c57a58723fea85f48'
+ '3f50f832eff04a00d59bd7fe19fd743b5639ea7cc78822329a77604f28e24102')
+
+prepare() {
+ cd "${pkgname}-${pkgver}"
+
+ patch -Np0 -i "${srcdir}/CVE-2014-9862.patch"
+}
+
+build() {
+ cd "${pkgname}-${pkgver}"
+
+ cc ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o bsdiff bsdiff.c -lbz2
+ cc ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} -o bspatch bspatch.c -lbz2
+}
+
+package() {
+ install -Dm755 "${srcdir}/${pkgname}-${pkgver}/bsdiff" "${pkgdir}/usr/bin/bsdiff"
+ install -Dm755 "${srcdir}/${pkgname}-${pkgver}/bspatch" "${pkgdir}/usr/bin/bspatch"
+
+ install -Dm644 "${srcdir}/${pkgname}-${pkgver}/bsdiff.1" "${pkgdir}/usr/share/man/man1/bsdiff.1"
+ install -Dm644 "${srcdir}/${pkgname}-${pkgver}/bspatch.1" "${pkgdir}/usr/share/man/man1/bspatch.1"
+}