From e00c13e4481ac272d5d997dbc99486b9f1456bf4 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Thu, 3 Dec 2015 18:31:24 +0100 Subject: [PATCH] New package: antiword-0.37 --- .../10_fix_buffer_overflow_wordole_c.patch | 18 +++++++++++++ srcpkgs/antiword/template | 26 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 srcpkgs/antiword/patches/10_fix_buffer_overflow_wordole_c.patch create mode 100644 srcpkgs/antiword/template diff --git a/srcpkgs/antiword/patches/10_fix_buffer_overflow_wordole_c.patch b/srcpkgs/antiword/patches/10_fix_buffer_overflow_wordole_c.patch new file mode 100644 index 00000000000..28af49b2ac4 --- /dev/null +++ b/srcpkgs/antiword/patches/10_fix_buffer_overflow_wordole_c.patch @@ -0,0 +1,18 @@ +Description: Add check for buffer overflow with malformed input files +Author: +Bug-Debian: http://bugs.debian.org/407015 +Last-Update: 2009-06-03 + +--- wordole.c 2005-08-26 21:49:57.000000000 +0200 ++++ wordole.c 2009-06-03 22:31:15.948014682 +0200 +@@ -259,6 +259,10 @@ + } + tNameSize = (size_t)usGetWord(0x40, aucBytes); + tNameSize = (tNameSize + 1) / 2; ++ if ( tNameSize > sizeof(atPPSlist[iIndex].szName)) { ++ werr(0, "Name Size of PPS %d is too large", iIndex); ++ tNameSize = sizeof(atPPSlist[iIndex].szName); ++ } + vName2String(atPPSlist[iIndex].szName, aucBytes, tNameSize); + atPPSlist[iIndex].ucType = ucGetByte(0x42, aucBytes); + if (atPPSlist[iIndex].ucType == 5) { diff --git a/srcpkgs/antiword/template b/srcpkgs/antiword/template new file mode 100644 index 00000000000..33733643d8a --- /dev/null +++ b/srcpkgs/antiword/template @@ -0,0 +1,26 @@ +# Template file for 'antiword' +pkgname=antiword +version=0.37 +revision=1 +short_desc="Converts the binary files from Word to plain text and to PostScript" +maintainer="Duncaen " +license="GPL-3" +homepage="http://www.winfield.demon.nl/" +distfiles="http://www.winfield.demon.nl/linux/antiword-${version}.tar.gz + http://sources.debian.net/data/main/a/antiword/0.37-10/debian/patches/docx.patch" +checksum="8e2c000fcbc6d641b0e6ff95e13c846da3ff31097801e86702124a206888f5ac + 0ca787f8e31a2e05e6c0ff73406d9a7f0355fe27238a0cde3ed7cf6d3418c8aa" + +do_build() { + # debian patch for better docx handling + mv ../docx.patch . + patch -Np1 -i docx.patch + # remove first line "#!/bin/bash" second one is "#!/bin/sh" + sed -i '1d' kantiword + make CC="$CC" LD="$CC" CFLAGS="$CFLAGS -DNDEBUG" LDFLAGS="$LDFLAGS" +} + +do_install() { + make DESTDIR="${DESTDIR}" GLOBAL_INSTALL_DIR="/usr/bin" global_install + vman Docs/antiword.1 +}