From owner-svn-ports-head@freebsd.org Tue Aug 11 22:06:21 2015 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CCEB99F0CB; Tue, 11 Aug 2015 22:06:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CD3627E; Tue, 11 Aug 2015 22:06:21 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7BM6LNi062318; Tue, 11 Aug 2015 22:06:21 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7BM6KAG062316; Tue, 11 Aug 2015 22:06:20 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201508112206.t7BM6KAG062316@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 11 Aug 2015 22:06:20 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r393978 - in head/textproc/expat2: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Aug 2015 22:06:21 -0000 Author: bapt Date: Tue Aug 11 22:06:20 2015 New Revision: 393978 URL: https://svnweb.freebsd.org/changeset/ports/393978 Log: Add patch for CVE-2015-1283 Added: head/textproc/expat2/files/ head/textproc/expat2/files/CVE-2015-1283.patch (contents, props changed) Modified: head/textproc/expat2/Makefile Modified: head/textproc/expat2/Makefile ============================================================================== --- head/textproc/expat2/Makefile Tue Aug 11 22:02:30 2015 (r393977) +++ head/textproc/expat2/Makefile Tue Aug 11 22:06:20 2015 (r393978) @@ -3,7 +3,7 @@ PORTNAME= expat PORTVERSION= 2.1.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= textproc MASTER_SITES= SF @@ -15,6 +15,8 @@ ALL_TARGET= default USES= libtool pathfix USE_LDCONFIG= yes +EXTRA_PATCHES= ${FILESDIR}/CVE-2015-1283.patch:-p1 + post-patch: @${REINPLACE_CMD} -e '/^DESTDIR =/d' ${WRKSRC}/Makefile.in Added: head/textproc/expat2/files/CVE-2015-1283.patch ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/textproc/expat2/files/CVE-2015-1283.patch Tue Aug 11 22:06:20 2015 (r393978) @@ -0,0 +1,77 @@ +Found at https://hg.mozilla.org/releases/mozilla-esr31/rev/2f3e78643f5c on 2015-07-27. Modified: replaced path parser/expat/lib/xmlparse.c with lib/xmlparse.c. +diff --git a/lib/xmlparse.c b/lib/xmlparse.c +--- a/lib/xmlparse.c ++++ b/lib/xmlparse.c +@@ -1646,29 +1646,40 @@ XML_ParseBuffer(XML_Parser parser, int l + XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position); + positionPtr = bufferPtr; + return result; + } + + void * XMLCALL + XML_GetBuffer(XML_Parser parser, int len) + { ++/* BEGIN MOZILLA CHANGE (sanity check len) */ ++ if (len < 0) { ++ errorCode = XML_ERROR_NO_MEMORY; ++ return NULL; ++ } ++/* END MOZILLA CHANGE */ + switch (ps_parsing) { + case XML_SUSPENDED: + errorCode = XML_ERROR_SUSPENDED; + return NULL; + case XML_FINISHED: + errorCode = XML_ERROR_FINISHED; + return NULL; + default: ; + } + + if (len > bufferLim - bufferEnd) { +- /* FIXME avoid integer overflow */ + int neededSize = len + (int)(bufferEnd - bufferPtr); ++/* BEGIN MOZILLA CHANGE (sanity check neededSize) */ ++ if (neededSize < 0) { ++ errorCode = XML_ERROR_NO_MEMORY; ++ return NULL; ++ } ++/* END MOZILLA CHANGE */ + #ifdef XML_CONTEXT_BYTES + int keep = (int)(bufferPtr - buffer); + + if (keep > XML_CONTEXT_BYTES) + keep = XML_CONTEXT_BYTES; + neededSize += keep; + #endif /* defined XML_CONTEXT_BYTES */ + if (neededSize <= bufferLim - buffer) { +@@ -1687,17 +1698,25 @@ XML_GetBuffer(XML_Parser parser, int len + } + else { + char *newBuf; + int bufferSize = (int)(bufferLim - bufferPtr); + if (bufferSize == 0) + bufferSize = INIT_BUFFER_SIZE; + do { + bufferSize *= 2; +- } while (bufferSize < neededSize); ++/* BEGIN MOZILLA CHANGE (prevent infinite loop on overflow) */ ++ } while (bufferSize < neededSize && bufferSize > 0); ++/* END MOZILLA CHANGE */ ++/* BEGIN MOZILLA CHANGE (sanity check bufferSize) */ ++ if (bufferSize <= 0) { ++ errorCode = XML_ERROR_NO_MEMORY; ++ return NULL; ++ } ++/* END MOZILLA CHANGE */ + newBuf = (char *)MALLOC(bufferSize); + if (newBuf == 0) { + errorCode = XML_ERROR_NO_MEMORY; + return NULL; + } + bufferLim = newBuf + bufferSize; + #ifdef XML_CONTEXT_BYTES + if (bufferPtr) { + + + +