- add patch to prevent buffer overflow

- bump PORTREVISION

PR:		195558
Submitted by:	fk@fabiankeil.de
This commit is contained in:
Yen-Ming Lee 2014-12-11 16:59:28 +00:00
parent 4f14f4634f
commit 02508190e4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=374539
3 changed files with 25 additions and 2 deletions

View File

@ -3,13 +3,15 @@
PORTNAME= antiword
PORTVERSION= 0.37
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= textproc
MASTER_SITES= http://www.winfield.demon.nl/linux/
MAINTAINER= leeym@FreeBSD.org
COMMENT= Application for displaying Microsoft(R) Word documents
OPTIONS_DEFINE= DEBUG
LICENSE= GPLv2
BUILD_DEPENDS= ${LOCALBASE}/share/ghostscript/fonts/n022003l.afm:${PORTSDIR}/print/gsfonts
@ -24,11 +26,17 @@ INSTALL_TARGET= global_install
PORTDOCS= COPYING ChangeLog Emacs Exmh FAQ History Mozilla Mutt Netscape \
QandA ReadMe antiword.1 antiword.man antiword.php testdoc.doc
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MDEBUG}
CFLAGS+= -DDEBUG
.else
CFLAGS+= -DNDEBUG
.endif
post-patch:
@${REINPLACE_CMD} -E 's,/usr/share,${LOCALBASE}/share,g; s,fonts2,fonts,' ${WRKSRC}/Unix-only/fontinfo.pl
@${REINPLACE_CMD} -E 's|LD|CC|g; /^(CC|CFLAGS)/d; s,/usr/share,${PREFIX}/share,g; s|/usr/local/bin|${PREFIX}/bin|g' ${WRKSRC}/${MAKEFILE}
@${REINPLACE_CMD} -E 's|LD|CC|g; /^(CC|CFLAGS|OPT)/d; s,/usr/share,${PREFIX}/share,g; s|/usr/local/bin|${PREFIX}/bin|g' ${WRKSRC}/${MAKEFILE}
@${REINPLACE_CMD} -E 's,/usr/share,${PREFIX}/share,g' ${WRKSRC}/antiword.h
post-install:

View File

@ -0,0 +1,14 @@
--- wordole.c
+++ wordole.c
@@ -259,6 +259,11 @@ bGetPPS(FILE *pFile,
}
tNameSize = (size_t)usGetWord(0x40, aucBytes);
tNameSize = (tNameSize + 1) / 2;
+ if (tNameSize >= sizeof(atPPSlist[0].szName)) {
+ werr(0, "PPS %d appears to be invalid.", iIndex);
+ atPPSlist = xfree(atPPSlist);
+ return FALSE;
+ }
vName2String(atPPSlist[iIndex].szName, aucBytes, tNameSize);
atPPSlist[iIndex].ucType = ucGetByte(0x42, aucBytes);
if (atPPSlist[iIndex].ucType == 5) {

View File

@ -32,3 +32,4 @@ man/man1/antiword.1.gz
%%DATADIR%%/koi8-r.txt
%%DATADIR%%/koi8-u.txt
%%DATADIR%%/roman.txt
@dirrmtry %%DATADIR%%