summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorPascal Wittmann <mail@pascal-wittmann.de>2015-03-09 18:27:25 +0100
committerPascal Wittmann <mail@pascal-wittmann.de>2015-03-09 18:27:25 +0100
commit3b1b8fb6296e2889c334447c1b83e698582f5349 (patch)
tree4b793ec26f7016233fdf9685d4fc4cfca6391286 /pkgs/applications/office
parenta9719f9dbb1c8cbc77a3588b58c70238a0febf3b (diff)
downloadnixpkgs-3b1b8fb6296e2889c334447c1b83e698582f5349.tar
nixpkgs-3b1b8fb6296e2889c334447c1b83e698582f5349.tar.gz
nixpkgs-3b1b8fb6296e2889c334447c1b83e698582f5349.tar.bz2
nixpkgs-3b1b8fb6296e2889c334447c1b83e698582f5349.tar.lz
nixpkgs-3b1b8fb6296e2889c334447c1b83e698582f5349.tar.xz
nixpkgs-3b1b8fb6296e2889c334447c1b83e698582f5349.tar.zst
nixpkgs-3b1b8fb6296e2889c334447c1b83e698582f5349.zip
antiword: apply debians patch for CVE-2014-8123
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771768
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/antiword/10_fix_buffer_overflow_wordole_c.patch18
-rw-r--r--pkgs/applications/office/antiword/default.nix4
2 files changed, 21 insertions, 1 deletions
diff --git a/pkgs/applications/office/antiword/10_fix_buffer_overflow_wordole_c.patch b/pkgs/applications/office/antiword/10_fix_buffer_overflow_wordole_c.patch
new file mode 100644
index 00000000000..ebf2f0900d9
--- /dev/null
+++ b/pkgs/applications/office/antiword/10_fix_buffer_overflow_wordole_c.patch
@@ -0,0 +1,18 @@
+Description: Add check for buffer overflow with malformed input files
+Author: <eriks@debian.org>
+Bug-Debian: http://bugs.debian.org/407015
+Last-Update: 2009-06-03
+
+--- antiword-0.37~/wordole.c	2005-08-26 21:49:57.000000000 +0200
++++ antiword-0.37/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/pkgs/applications/office/antiword/default.nix b/pkgs/applications/office/antiword/default.nix
index f889490a862..ea36d59eea7 100644
--- a/pkgs/applications/office/antiword/default.nix
+++ b/pkgs/applications/office/antiword/default.nix
@@ -11,10 +11,12 @@ stdenv.mkDerivation {
     sha256 = "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f";
   };
 
-  patchPhase = ''
+  preInstall = ''
     sed -i -e "s|/usr/local/bin|$out/bin|g" -e "s|/usr/share|$out/share|g" Makefile antiword.h
   '';
 
+  patches = [ ./10_fix_buffer_overflow_wordole_c.patch ];
+
   installTargets = "global_install";
 
   meta = {