diff -Nru antiword-0.37/debian/changelog antiword-0.37/debian/changelog --- antiword-0.37/debian/changelog 2014-10-17 10:24:13.000000000 +0000 +++ antiword-0.37/debian/changelog 2016-01-11 23:08:47.000000000 +0000 @@ -1,3 +1,17 @@ +antiword (0.37-11) unstable; urgency=medium + + * Fix FTCBFS: set CC to host arch compiler, based on patch from Helmut + Grohne. (Closes: #793900) + * 10_fix_buffer_overflow_wordole_c.patch: Update metadata to note that this + was refound and assigned CVE-2014-8123. + * docx.patch: Extend to check for XML files and give a more helpful error + for those too. (Closes: #791532) Similarly check for HTML files, which + are sometimes seen with a ".doc" extension. + * remove-cjb.net-references.patch: New patch to remove cjb.net references. + The domain has been let lapse and is now a holding page. + + -- Olly Betts Tue, 12 Jan 2016 11:39:10 +1300 + antiword (0.37-10) unstable; urgency=medium * Give a more specific error for MS XML documents, and patch documentation diff -Nru antiword-0.37/debian/patches/10_fix_buffer_overflow_wordole_c.patch antiword-0.37/debian/patches/10_fix_buffer_overflow_wordole_c.patch --- antiword-0.37/debian/patches/10_fix_buffer_overflow_wordole_c.patch 2011-11-26 13:20:25.000000000 +0000 +++ antiword-0.37/debian/patches/10_fix_buffer_overflow_wordole_c.patch 2016-01-11 22:19:11.000000000 +0000 @@ -1,7 +1,10 @@ Description: Add check for buffer overflow with malformed input files + This was later re-found and became CVE-2014-8123. Author: Bug-Debian: http://bugs.debian.org/407015 -Last-Update: 2009-06-03 +Bug-Debian: https://bugs.debian.org/771768 +Forwarded: http://seclists.org/oss-sec/2014/q4/870 +Last-Update: 2016-01-11 --- 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 diff -Nru antiword-0.37/debian/patches/docx.patch antiword-0.37/debian/patches/docx.patch --- antiword-0.37/debian/patches/docx.patch 2014-10-17 10:27:17.000000000 +0000 +++ antiword-0.37/debian/patches/docx.patch 2016-01-11 23:15:19.000000000 +0000 @@ -1,36 +1,41 @@ Description: Try to reduce confusion around docx files + Now also checks for XML files and HTML files Author: Olly Betts Bug-Debian: https://bugs.debian.org/758959 +Bug-Debian: https://bugs.debian.org/791532 Forwarded: no -Last-Update: 2014-10-17 +Last-Update: 2015-01-11 ---- antiword-0.37.orig/Docs/antiword.1 -+++ antiword-0.37/Docs/antiword.1 -@@ -14,7 +14,10 @@ documents. +--- a/Docs/antiword.1 ++++ b/Docs/antiword.1 +@@ -14,7 +14,11 @@ .br A wordfile named - stands for a Word document read from the standard input. .br -Only documents made by MS Word version 2 and version 6 or later are supported. -+Only documents made by MS Word version 2, 6, 7, 97, 2000 and 2003 are -+supported. Newer Word versions default to using a completely different format -+consisting of XML files in a ZIP container (usually with a .docx file -+extension) which antiword doesn't support. ++Only the binary format documents made by MS Word version 2, 6, 7, 97, 2000 and ++2003 are supported. Newer Word versions default to using a completely ++different format consisting of XML files in a ZIP container (usually with a ++".docx" file extension) which antiword doesn't support. It also doesn't ++support the "flat" XML format which MS Word 2003 supported. .SH OPTIONS .TP .BI "\-a " papersize ---- antiword-0.37.orig/antiword.h -+++ antiword-0.37/antiword.h -@@ -695,6 +695,7 @@ extern int iInitDocumentDOS(FILE *, long +--- a/antiword.h ++++ b/antiword.h +@@ -695,6 +695,9 @@ extern BOOL bIsWordForDosFile(FILE *, long); extern BOOL bIsRtfFile(FILE *); extern BOOL bIsWordPerfectFile(FILE *); +extern BOOL bIsZipFile(FILE *); ++extern BOOL bIsXMLFile(FILE *); ++extern BOOL bIsHTMLFile(FILE *); extern BOOL bIsWinWord12File(FILE *, long); extern BOOL bIsMacWord45File(FILE *); extern int iGuessVersionNumber(FILE *, long); ---- antiword-0.37.orig/main_u.c -+++ antiword-0.37/main_u.c -@@ -187,10 +187,17 @@ bProcessFile(const char *szFilename) +--- a/main_u.c ++++ b/main_u.c +@@ -187,10 +187,29 @@ werr(0, "%s is not a Word Document." " It is probably a Rich Text Format file", szFilename); @@ -41,17 +46,65 @@ szFilename); + } else if (bIsZipFile(pFile)) { + werr(0, "%s is not a Word Document." -+ " It is probably an OpenDocument file or" -+ " a new-style Microsoft Office XML file" -+ " (antiword only handles documents from" -+ " MS Word 2003 and earlier)", ++ " It seems to be a ZIP file, so is probably" ++ " an OpenDocument file, or a \"docx\" file" ++ " from MS Word 2007 or newer" ++ " (antiword only handles binary format" ++ " documents from MS Word 2003 and earlier)", ++ szFilename); ++ } else if (bIsXMLFile(pFile)) { ++ werr(0, "%s is not a Word Document." ++ " It seems to be an XML file, perhaps" ++ " the XML format from MS Word 2003" ++ " (antiword only handles binary format" ++ " documents from MS Word 2003 and earlier)", ++ szFilename); ++ } else if (bIsHTMLFile(pFile)) { ++ werr(0, "%s is not a Word Document." ++ " It is probably an HTML file", + szFilename); } else { #if defined(__dos) werr(0, "%s is not a Word Document or the filename" ---- antiword-0.37.orig/wordlib.c -+++ antiword-0.37/wordlib.c -@@ -131,6 +131,20 @@ bIsWordPerfectFile(FILE *pFile) +--- a/wordlib.c ++++ b/wordlib.c +@@ -41,7 +41,7 @@ + BOOL + bIsWordForDosFile(FILE *pFile, long lFilesize) + { +- static UCHAR aucBytes[] = ++ static const UCHAR aucBytes[] = + { 0x31, 0xbe, 0x00, 0x00, 0x00, 0xab }; /* Word for DOS */ + + DBG_MSG("bIsWordForDosFile"); +@@ -64,7 +64,7 @@ + static BOOL + bIsWordFileWithOLE(FILE *pFile, long lFilesize) + { +- static UCHAR aucBytes[] = ++ static const UCHAR aucBytes[] = + { 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1 }; + int iTailLen; + +@@ -108,7 +108,7 @@ + BOOL + bIsRtfFile(FILE *pFile) + { +- static UCHAR aucBytes[] = ++ static const UCHAR aucBytes[] = + { '{', '\\', 'r', 't', 'f', '1' }; + + DBG_MSG("bIsRtfFile"); +@@ -122,7 +122,7 @@ + BOOL + bIsWordPerfectFile(FILE *pFile) + { +- static UCHAR aucBytes[] = ++ static const UCHAR aucBytes[] = + { 0xff, 'W', 'P', 'C' }; + + DBG_MSG("bIsWordPerfectFile"); +@@ -131,13 +131,65 @@ } /* end of bIsWordPerfectFile */ /* @@ -60,7 +113,7 @@ +BOOL +bIsZipFile(FILE *pFile) +{ -+ static UCHAR aucBytes[] = ++ static const UCHAR aucBytes[] = + { 'P', 'K', 0x03, 0x04 }; + + DBG_MSG("bIsZipFile"); @@ -69,6 +122,61 @@ +} /* end of bIsZipFile */ + +/* ++ * This function checks whether the given file is or is not a XML file ++ */ ++BOOL ++bIsXMLFile(FILE *pFile) ++{ ++ static const UCHAR aucBytes[] = ++ { '<', '?', 'x', 'm', 'l' }; ++ ++ DBG_MSG("bIsXMLFile"); ++ ++ return bCheckBytes(pFile, aucBytes, elementsof(aucBytes)); ++} /* end of bIsXMLFile */ ++ ++/* ++ * This function checks whether the given file is or is not a HTML file ++ */ ++BOOL ++bIsHTMLFile(FILE *pFile) ++{ ++ static const UCHAR aucBytes[2][5] = { ++ { '<', 'h', 't', 'm', 'l' }, ++ { '<', 'H', 'T', 'M', 'L' }, ++ }; ++ int iIndex; ++ ++ DBG_MSG("bIsHTMLFile"); ++ ++ for (iIndex = 0; iIndex < (int)elementsof(aucBytes); iIndex++) { ++ if (bCheckBytes(pFile, ++ aucBytes[iIndex], ++ elementsof(aucBytes[iIndex]))) { ++ return TRUE; ++ } ++ } ++ return FALSE; ++} /* end of bIsHTMLFile */ ++ ++/* * This function checks whether the given file is or is not a "Win Word 1 or 2" * document */ + BOOL + bIsWinWord12File(FILE *pFile, long lFilesize) + { +- static UCHAR aucBytes[2][4] = { ++ static const UCHAR aucBytes[2][4] = { + { 0x9b, 0xa5, 0x21, 0x00 }, /* Win Word 1.x */ + { 0xdb, 0xa5, 0x2d, 0x00 }, /* Win Word 2.0 */ + }; +@@ -171,7 +223,7 @@ + BOOL + bIsMacWord45File(FILE *pFile) + { +- static UCHAR aucBytes[2][6] = { ++ static const UCHAR aucBytes[2][6] = { + { 0xfe, 0x37, 0x00, 0x1c, 0x00, 0x00 }, /* Mac Word 4 */ + { 0xfe, 0x37, 0x00, 0x23, 0x00, 0x00 }, /* Mac Word 5 */ + }; diff -Nru antiword-0.37/debian/patches/remove-cjb.net-references.patch antiword-0.37/debian/patches/remove-cjb.net-references.patch --- antiword-0.37/debian/patches/remove-cjb.net-references.patch 1970-01-01 00:00:00.000000000 +0000 +++ antiword-0.37/debian/patches/remove-cjb.net-references.patch 2016-01-11 22:38:29.000000000 +0000 @@ -0,0 +1,40 @@ +Description: Remove cjb.net references + The domain has been let lapse and is now a holding page. +Author: Olly Betts +Forwarded: no +Last-Update: 2016-01-11 + +--- antiword-0.37.orig/Docs/ReadMe ++++ antiword-0.37/Docs/ReadMe +@@ -101,7 +101,6 @@ Most recent version + + Most recent version of Antiword can be found on the author's website: + ==>> http://www.winfield.demon.nl/index.html <<== +-==>> http://antiword.cjb.net/ <<== + + + Author +@@ -109,6 +108,5 @@ Author + + The author can be reached by e-mail: + antiword@winfield.demon.nl +-comments@antiword.cjb.net + + But PLEASE read the FAQ before you write!! +--- antiword-0.37.orig/Docs/antiword.1 ++++ antiword-0.37/Docs/antiword.1 +@@ -125,14 +125,8 @@ PostScript output is only available in I + The most recent released version of Antiword is always available from: + .br + http://www.winfield.demon.nl/index.html +-.br +-or try +-.br +-http://antiword.cjb.net/ + .SH AUTHOR + Adri van Os +-.br +-or try + .sp + R.F. Smith and + .br diff -Nru antiword-0.37/debian/patches/series antiword-0.37/debian/patches/series --- antiword-0.37/debian/patches/series 2014-10-17 10:26:06.000000000 +0000 +++ antiword-0.37/debian/patches/series 2016-01-11 22:37:43.000000000 +0000 @@ -4,3 +4,4 @@ 40_desktop_files.patch 50_antiword-manpage-hyphen-to-minus.patch docx.patch +remove-cjb.net-references.patch diff -Nru antiword-0.37/debian/rules antiword-0.37/debian/rules --- antiword-0.37/debian/rules 2013-05-30 04:57:39.000000000 +0000 +++ antiword-0.37/debian/rules 2016-01-11 23:04:43.000000000 +0000 @@ -1,5 +1,11 @@ #!/usr/bin/make -f +DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +ifeq ($(origin CC),default) + CC = $(DEB_HOST_GNU_TYPE)-gcc +endif + CFLAGS += -Wall -pedantic -D_FILE_OFFSET_BITS=64 ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) CFLAGS += -DDEBUG @@ -11,7 +17,7 @@ dh $@ override_dh_auto_build: - $(MAKE) -f Makefile.Linux LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS) $(CPPFLAGS)" + $(MAKE) -f Makefile.Linux CC=$(CC) LD=$(CC) LDFLAGS="$(LDFLAGS)" CFLAGS="$(CFLAGS) $(CPPFLAGS)" override_dh_auto_clean: [ ! -f Makefile.Linux ] || $(MAKE) -f Makefile.Linux clean