Package: release.debian.org
Severity: normal
Tags: trixie
User: [email protected]
Usertags: pu


The attached debdiff for antiword fixes some temporary issues (that got no CVE yet) in Trixie. Those issues are marked as no-dsa by the security team.

The same patches have been uploaded to unstable and all other LTS/ELTS releases some days ago as well and nobody complained yet.

   Thorsten

PS: to accelerate things I already upload the package ...
diff -Nru antiword-0.37/debian/changelog antiword-0.37/debian/changelog
--- antiword-0.37/debian/changelog      2025-04-18 04:12:49.000000000 +0200
+++ antiword-0.37/debian/changelog      2026-10-23 11:03:02.000000000 +0200
@@ -1,3 +1,19 @@
+antiword (0.37-17+deb13u1) trixie; urgency=medium
+
+  * Non-maintainer upload by the LTS Team.
+  * add fix-write-after-end-of-font-table.patch (Closes: #1144643)
+    Fix write one past end of font table array.
+  * add check_fonttable_bounds.patch (Closes: #1144645)
+    Add missing checks for running off the end of the fonttable.
+  * fix-divide-by-zero.patch (Closes: #1144640)
+    Avoid integer divide by zero.
+  * fix-oob-read-properties.patch (Closes: #1008092, #1144641, #1144642)
+    Fix OOB read reading document properties.
+  * update stop-parsing-documentsummary.patch
+    add additional parameter to pucAnalyseSummaryInfoHeader()
+
+ -- Thorsten Alteholz <[email protected]>  Fri, 23 Oct 2026 11:03:02 +0200
+
 antiword (0.37-17) unstable; urgency=medium
 
   * Upstream Homepage has gone so remove references to it.
diff -Nru antiword-0.37/debian/patches/check_fonttable_bounds.patch 
antiword-0.37/debian/patches/check_fonttable_bounds.patch
--- antiword-0.37/debian/patches/check_fonttable_bounds.patch   1970-01-01 
01:00:00.000000000 +0100
+++ antiword-0.37/debian/patches/check_fonttable_bounds.patch   2026-10-23 
11:03:02.000000000 +0200
@@ -0,0 +1,38 @@
+Description: Add missing checks for running off the end of the fonttable
+Author: <[email protected]>
+Bug-Debian: https://bugs.debian.org/1144645
+Forwarded: not-needed
+Last-Update: 2026-08-24
+
+--- a/fonts.c
++++ b/fonts.c
+@@ -657,6 +657,9 @@
+                       aucFont = aucBuffer + iPos + iOff;
+                       vFontname2Table(aucFont, NULL, 1, iEmphasis,
+                                       ucFFN, szWordFont, szOurFont, pTmp);
++                      if (tFontTableRecords - (pTmp - pFontTable) <= 4) {
++                          break;
++                      }
+                       pTmp += 4;
+                       iPos += iRecLen + 1;
+               }
+@@ -760,6 +763,9 @@
+                       }
+                       vFontname2Table(aucFont, aucAltFont, 1, iEmphasis,
+                                       ucFFN, szWordFont, szOurFont, pTmp);
++                      if (tFontTableRecords - (pTmp - pFontTable) <= 4) {
++                          break;
++                      }
+                       pTmp += 4;
+                       iPos += iRecLen + 1;
+               }
+@@ -872,6 +878,9 @@
+                       }
+                       vFontname2Table(aucFont, aucAltFont, 2, iEmphasis,
+                                       ucFFN, szWordFont, szOurFont, pTmp);
++                      if (tFontTableRecords - (pTmp - pFontTable) <= 4) {
++                          break;
++                      }
+                       pTmp += 4;
+                       iPos += iRecLen + 1;
+               }
diff -Nru antiword-0.37/debian/patches/fix-divide-by-zero.patch 
antiword-0.37/debian/patches/fix-divide-by-zero.patch
--- antiword-0.37/debian/patches/fix-divide-by-zero.patch       1970-01-01 
01:00:00.000000000 +0100
+++ antiword-0.37/debian/patches/fix-divide-by-zero.patch       2026-10-23 
11:03:02.000000000 +0200
@@ -0,0 +1,24 @@
+Description: Fix integer divide by zero
+Author: <[email protected]>
+Bug-Debian: https://bugs.debian.org/1144640
+Forwarded: not-needed
+Last-Update: 2026-08-24
+
+diff --git a/word2text.c b/word2text.c
+index 62b8964c..45f1b60c 100644
+--- a/word2text.c
++++ b/word2text.c
+@@ -398,7 +398,12 @@ vPutSeparatorLine(output_type *pOutput)
+       lCharWidth = lComputeStringWidth(szOne, 1,
+                               pOutput->tFontRef, pOutput->usFontSize);
+       NO_DBG_DEC(lCharWidth);
+-      iChars = (int)((144000 + lCharWidth / 2) / lCharWidth);
++      if (lCharWidth > 0) {
++          iChars = (int)((144000 + lCharWidth / 2) / lCharWidth);
++      } else {
++          /* Avoid integer divide by zero. */
++          iChars = 12;
++      }
+       NO_DBG_DEC(iChars);
+       for (iCounter = 0; iCounter < iChars; iCounter++) {
+               vStoreCharacter((ULONG)(UCHAR)OUR_EM_DASH, pOutput);
diff -Nru antiword-0.37/debian/patches/fix-oob-read-properties.patch 
antiword-0.37/debian/patches/fix-oob-read-properties.patch
--- antiword-0.37/debian/patches/fix-oob-read-properties.patch  1970-01-01 
01:00:00.000000000 +0100
+++ antiword-0.37/debian/patches/fix-oob-read-properties.patch  2026-10-23 
11:03:02.000000000 +0200
@@ -0,0 +1,161 @@
+Description: Fix OOB read reading document properties
+Author: <[email protected]>
+Bug-Debian: https://bugs.debian.org/1008092
+Bug-Debian: https://bugs.debian.org/1144641
+Bug-Debian: https://bugs.debian.org/1144642
+Forwarded: not-needed
+Last-Update: 2026-08-24
+
+Index: antiword-0.37/summary.c
+===================================================================
+--- antiword-0.37.orig/summary.c       2026-10-23 12:55:23.081579017 +0200
++++ antiword-0.37/summary.c    2026-10-23 12:55:23.077578984 +0200
+@@ -134,20 +134,32 @@
+  * szLpstr - get a zero terminate string property
+  */
+ static char *
+-szLpstr(ULONG ulOffset, const UCHAR *aucBuffer)
++szLpstr(ULONG ulOffset, const UCHAR *aucBuffer, size_t buffer_length)
+ {
+       char    *szStart, *szResult, *szTmp;
+       size_t  tSize;
+ 
++      if (ulOffset + 8 > buffer_length) {
++              return NULL;
++      }
++
+       tSize = (size_t)ulGetLong(ulOffset + 4, aucBuffer);
+       NO_DBG_DEC(tSize);
+-      if (tSize == 0) {
++      if (tSize == 0 || tSize > buffer_length - (ulOffset + 8)) {
+               return NULL;
+       }
+-      /* Remove white space from the start of the string */
++
+       szStart = (char *)aucBuffer + ulOffset + 8;
++
++      /* Check for terminating zero within buffer. */
++      for (szTmp = szStart + tSize - 1; *szTmp; --szTmp) {
++              if (szTmp == szStart) {
++                      return NULL;
++              }
++      }
++
++      /* Remove white space from the start of the string */
+       NO_DBG_MSG(szStart);
+-      fail(strlen(szStart) >= tSize);
+       while (isspace(*szStart)) {
+               szStart++;
+       }
+@@ -169,12 +181,16 @@
+  * tFiletime - get a filetime property
+  */
+ static time_t
+-tFiletime(ULONG ulOffset, const UCHAR *aucBuffer)
++tFiletime(ULONG ulOffset, const UCHAR *aucBuffer, size_t buffer_length)
+ {
+       double  dHi, dLo, dTmp;
+       ULONG   ulHi, ulLo;
+       time_t  tResult;
+ 
++      if (ulOffset + 8 > buffer_length) {
++              return (time_t)-1;
++      }
++
+       ulLo = ulGetLong(ulOffset + 4, aucBuffer);
+       ulHi = ulGetLong(ulOffset + 8, aucBuffer);
+       NO_DBG_HEX(ulHi);
+@@ -204,7 +220,7 @@
+  * vAnalyseSummaryInfo - analyse the summary information
+  */
+ static void
+-vAnalyseSummaryInfo(const UCHAR *aucBuffer)
++vAnalyseSummaryInfo(const UCHAR *aucBuffer, size_t buffer_length)
+ {
+       ULONG   ulOffset;
+       size_t  tIndex, tCount, tPropID, tPropType;
+@@ -212,43 +228,48 @@
+       tCount = (size_t)ulGetLong(4, aucBuffer);
+       DBG_DEC(tCount);
+       for (tIndex = 0; tIndex < tCount; tIndex++) {
+-              tPropID = (size_t)ulGetLong(8 + tIndex * 8, aucBuffer);
+-              ulOffset = ulGetLong(12 + tIndex * 8, aucBuffer);
++              size_t offset = 8 + tIndex * 8;
++              if (offset + 4 > buffer_length) return;
++              tPropID = (size_t)ulGetLong(offset, aucBuffer);
++              offset += 4;
++              if (offset + 4 > buffer_length) return;
++              ulOffset = ulGetLong(offset, aucBuffer);
+               NO_DBG_DEC(tPropID);
+               NO_DBG_HEX(ulOffset);
++              if (ulOffset + 4 > buffer_length) return;
+               tPropType = (size_t)ulGetLong(ulOffset, aucBuffer);
+               NO_DBG_DEC(tPropType);
+               switch (tPropID) {
+               case PID_TITLE:
+                       if (tPropType == VT_LPSTR && szTitle == NULL) {
+-                              szTitle = szLpstr(ulOffset, aucBuffer);
++                              szTitle = szLpstr(ulOffset, aucBuffer, 
buffer_length);
+                       }
+                       break;
+               case PID_SUBJECT:
+                       if (tPropType == VT_LPSTR && szSubject == NULL) {
+-                              szSubject = szLpstr(ulOffset, aucBuffer);
++                              szSubject = szLpstr(ulOffset, aucBuffer, 
buffer_length);
+                       }
+                       break;
+               case PID_AUTHOR:
+                       if (tPropType == VT_LPSTR && szAuthor == NULL) {
+-                              szAuthor = szLpstr(ulOffset, aucBuffer);
++                              szAuthor = szLpstr(ulOffset, aucBuffer, 
buffer_length);
+                       }
+                       break;
+               case PID_CREATE_DTM:
+                       if (tPropType == VT_FILETIME &&
+                           tCreateDtm == (time_t)-1) {
+-                              tCreateDtm = tFiletime(ulOffset, aucBuffer);
++                              tCreateDtm = tFiletime(ulOffset, aucBuffer, 
buffer_length);
+                       }
+                       break;
+               case PID_LASTSAVE_DTM:
+                       if (tPropType == VT_FILETIME &&
+                           tLastSaveDtm == (time_t)-1) {
+-                              tLastSaveDtm = tFiletime(ulOffset, aucBuffer);
++                              tLastSaveDtm = tFiletime(ulOffset, aucBuffer, 
buffer_length);
+                       }
+                       break;
+               case PID_APPNAME:
+                       if (tPropType == VT_LPSTR && szAppName == NULL) {
+-                              szAppName = szLpstr(ulOffset, aucBuffer);
++                              szAppName = szLpstr(ulOffset, aucBuffer, 
buffer_length);
+                       }
+                       break;
+               default:
+@@ -375,6 +396,7 @@
+               return NULL;
+       }
+       NO_DBG_PRINT_BLOCK(aucBuffer, tLength);
++      *result_length = tLength;
+       return aucBuffer;
+ } /* end of pucAnalyseSummaryInfoHeader */
+ 
+@@ -578,6 +600,7 @@
+       const ULONG *aulSBD, size_t tSBDLen)
+ {
+       UCHAR   *pucBuffer;
++      size_t  buffer_length;
+ 
+       fail(pFile == NULL || pPPS == NULL);
+       fail(aulBBD == NULL || aulSBD == NULL);
+@@ -585,9 +608,9 @@
+       /* Summary Information */
+       pucBuffer = pucAnalyseSummaryInfoHeader(pFile,
+               pPPS->tSummaryInfo.ulSB, pPPS->tSummaryInfo.ulSize,
+-              aulBBD, tBBDLen, aulSBD, tSBDLen);
++              aulBBD, tBBDLen, aulSBD, tSBDLen, &buffer_length);
+       if (pucBuffer != NULL) {
+-              vAnalyseSummaryInfo(pucBuffer);
++              vAnalyseSummaryInfo(pucBuffer, buffer_length);
+               pucBuffer = xfree(pucBuffer);
+       }
+ } /* end of vSetSummaryInfoOLE */
diff -Nru antiword-0.37/debian/patches/fix-write-after-end-of-font-table.patch 
antiword-0.37/debian/patches/fix-write-after-end-of-font-table.patch
--- antiword-0.37/debian/patches/fix-write-after-end-of-font-table.patch        
1970-01-01 01:00:00.000000000 +0100
+++ antiword-0.37/debian/patches/fix-write-after-end-of-font-table.patch        
2026-10-23 11:03:02.000000000 +0200
@@ -0,0 +1,32 @@
+Description: Fix write one past end of font table array
+Author: <[email protected]>
+Bug-Debian: https://bugs.debian.org/1144643
+Forwarded: not-needed
+Last-Update: 2026-08-24
+
+diff --git a/fonts.c b/fonts.c
+index 77fde74e..1f18e09b 100644
+--- a/fonts.c
++++ b/fonts.c
+@@ -371,14 +371,19 @@ vMinimizeFontTable(void)
+       tFontTableRecords -= (size_t)iUnUsed;
+ 
+       if (bMustAddTableFont) {
+-              pTmp = pFontTable + tFontTableRecords;
++              pTmp = pFontTable + tFontTableRecords - 1;
++              if (pTmp->ucInUse) {
++                  /* We allocated an extra slot for the table font so the
++                   * last entry should not be in use.
++                   */
++                  werr(1, "More font entries than expected\n");
++              }
+               fail(pTmp <= pFontTable);
+               pTmp->ucWordFontNumber = (pTmp - 1)->ucWordFontNumber + 1;
+               pTmp->usFontStyle = FONT_REGULAR;
+               pTmp->ucInUse = 1;
+               strcpy(pTmp->szWordFontname, "Extra Table Font");
+               strcpy(pTmp->szOurFontname, TABLE_FONT);
+-              tFontTableRecords++;
+               iUnUsed--;
+       }
+       if (iUnUsed > 0) {
diff -Nru antiword-0.37/debian/patches/series 
antiword-0.37/debian/patches/series
--- antiword-0.37/debian/patches/series 2024-04-11 06:59:44.000000000 +0200
+++ antiword-0.37/debian/patches/series 2026-10-23 11:03:02.000000000 +0200
@@ -3,4 +3,10 @@
 docx.patch
 remove-dead-upstream-links.patch
 use-snprintf.patch
+
 stop-parsing-documentsummary.patch
+
+fix-write-after-end-of-font-table.patch
+check_fonttable_bounds.patch
+fix-divide-by-zero.patch
+fix-oob-read-properties.patch
diff -Nru antiword-0.37/debian/patches/stop-parsing-documentsummary.patch 
antiword-0.37/debian/patches/stop-parsing-documentsummary.patch
--- antiword-0.37/debian/patches/stop-parsing-documentsummary.patch     
2025-04-18 02:18:26.000000000 +0200
+++ antiword-0.37/debian/patches/stop-parsing-documentsummary.patch     
2026-10-23 11:03:02.000000000 +0200
@@ -9,9 +9,9 @@
 Forwarded: not-needed
 Last-Update: 2025-04-18
 
---- antiword-0.37.orig/antiword.h
-+++ antiword-0.37/antiword.h
-@@ -657,7 +657,6 @@ extern const char  *szGetAuthor(void);
+--- a/antiword.h
++++ b/antiword.h
+@@ -657,7 +657,6 @@
  extern const char     *szGetLastSaveDtm(void);
  extern const char     *szGetModDate(void);
  extern const char     *szGetCreationDate(void);
@@ -19,9 +19,9 @@
  extern const char     *szGetLanguage(void);
  /* tabstop.c */
  extern void   vSetDefaultTabWidth(FILE *, const pps_info_type *,
---- antiword-0.37.orig/summary.c
-+++ antiword-0.37/summary.c
-@@ -38,8 +38,6 @@ static char  *szAuthor = NULL;
+--- a/summary.c
++++ b/summary.c
+@@ -38,8 +38,6 @@
  static time_t tCreateDtm = (time_t)-1;
  static time_t tLastSaveDtm= (time_t)-1;
  static char   *szAppName = NULL;
@@ -30,7 +30,7 @@
  static USHORT usLid = (USHORT)-1;
  
  
-@@ -57,8 +55,6 @@ vDestroySummaryInfo(void)
+@@ -57,8 +55,6 @@
        tCreateDtm = (time_t)-1;
        tLastSaveDtm = (time_t)-1;
        szAppName = xfree(szAppName);
@@ -39,7 +39,7 @@
        usLid = (USHORT)-1;
  } /* end of vDestroySummaryInfo */
  
-@@ -262,41 +258,6 @@ vAnalyseSummaryInfo(const UCHAR *aucBuff
+@@ -262,48 +258,14 @@
  } /* end of vAnalyseSummaryInfo */
  
  /*
@@ -81,7 +81,16 @@
   * pucAnalyseSummaryInfoHeader-
   */
  static UCHAR *
-@@ -628,15 +589,6 @@ vSetSummaryInfoOLE(FILE *pFile, const pp
+ pucAnalyseSummaryInfoHeader(FILE *pFile,
+       ULONG ulStartBlock, ULONG ulSize,
+       const ULONG *aulBBD, size_t tBBDLen,
+-      const ULONG *aulSBD, size_t tSBDLen)
++      const ULONG *aulSBD, size_t tSBDLen,
++      size_t *result_length)
+ {
+       const ULONG     *aulBlockDepot;
+       UCHAR   *aucBuffer;
+@@ -628,15 +590,6 @@
                vAnalyseSummaryInfo(pucBuffer);
                pucBuffer = xfree(pucBuffer);
        }
@@ -97,7 +106,7 @@
  } /* end of vSetSummaryInfoOLE */
  
  /*
-@@ -779,15 +731,6 @@ szGetCreationDate(void)
+@@ -779,15 +732,6 @@
  } /* end of szGetCreationDate */
  
  /*
@@ -113,9 +122,9 @@
   * szGetLanguage - get de language field
   */
  const char *
---- antiword-0.37.orig/xml.c
-+++ antiword-0.37/xml.c
-@@ -681,7 +681,7 @@ vCreateBookIntro(diagram_type *pDiag, in
+--- a/xml.c
++++ b/xml.c
+@@ -681,7 +681,7 @@
        szSubject = szGetSubject();
        szAuthor = szGetAuthor();
        szLastSaveDtm = szGetLastSaveDtm();

Reply via email to