%D%/packages/patches/emacs-source-date-epoch.patch \
%D%/packages/patches/eudev-rules-directory.patch \
%D%/packages/patches/evilwm-lost-focus-bug.patch \
- %D%/packages/patches/expat-CVE-2015-1283.patch \
+ %D%/packages/patches/expat-CVE-2012-6702-and-CVE-2016-5300.patch \
%D%/packages/patches/expat-CVE-2015-1283-refix.patch \
%D%/packages/patches/expat-CVE-2016-0718.patch \
%D%/packages/patches/fastcap-mulGlobal.patch \
--Update previous fix for CVE-2015-1283 to not rely on undefined behavior.
++Follow-up upstream fix for CVE-2015-1283 to not rely on undefined
++behavior.
--Copied from Debian, as found in Debian package version 2.1.0-6+deb8u2.
++Adapted from a patch from Debian (found in Debian package version
++2.1.0-6+deb8u2) to apply to upstream code:
https://sources.debian.net/src/expat/2.1.0-6%2Bdeb8u2/debian/patches/CVE-2015-1283-refix.patch/
--From 29a11774d8ebbafe8418b4a5ffb4cc1160b194a1 Mon Sep 17 00:00:00 2001
--From: Pascal Cuoq <cuoq@trust-in-soft.com>
--Date: Sun, 15 May 2016 09:05:46 +0200
--Subject: [PATCH] Avoid relying on undefined behavior in CVE-2015-1283 fix.
--
---
-- expat/lib/xmlparse.c | 6 ++++--
++ lib/xmlparse.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/xmlparse.c b/lib/xmlparse.c
--index 13e080d..cdb12ef 100644
++index 0f6f4cd..5c70c17 100644
--- a/lib/xmlparse.c
+++ b/lib/xmlparse.c
--@@ -1695,7 +1695,8 @@ XML_GetBuffer(XML_Parser parser, int len
++@@ -1727,7 +1727,8 @@ XML_GetBuffer(XML_Parser parser, int len)
}
if (len > bufferLim - bufferEnd) {
- int neededSize = len + (int)(bufferEnd - bufferPtr);
+ /* Do not invoke signed arithmetic overflow: */
+ int neededSize = (int) ((unsigned)len + (unsigned)(bufferEnd - bufferPtr));
-- /* BEGIN MOZILLA CHANGE (sanity check neededSize) */
if (neededSize < 0) {
errorCode = XML_ERROR_NO_MEMORY;
--@@ -1729,7 +1730,8 @@ XML_GetBuffer(XML_Parser parser, int len
++ return NULL;
++@@ -1759,7 +1760,8 @@ XML_GetBuffer(XML_Parser parser, int len)
if (bufferSize == 0)
bufferSize = INIT_BUFFER_SIZE;
do {
- bufferSize *= 2;
+ /* Do not invoke signed arithmetic overflow: */
+ bufferSize = (int) (2U * (unsigned) bufferSize);
-- /* BEGIN MOZILLA CHANGE (prevent infinite loop on overflow) */
} while (bufferSize < neededSize && bufferSize > 0);
-- /* END MOZILLA CHANGE */
++ if (bufferSize <= 0) {
++ errorCode = XML_ERROR_NO_MEMORY;
--
--2.8.2
++2.8.3
;;; Copyright © 2013, 2015 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2015 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
- ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
+ ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2015, 2016 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2015 Raimon Grau <raimonster@gmail.com>
+;;; Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;;
;;; This file is part of GNU Guix.
(source (origin
(method url-fetch)
(uri (string-append "mirror://sourceforge/expat/expat/"
- version "/expat-" version ".tar.gz"))
+ version "/expat-" version ".tar.bz2"))
++ (patches (search-patches "expat-CVE-2012-6702-and-CVE-2016-5300.patch"
++ "expat-CVE-2015-1283-refix.patch"
++ "expat-CVE-2016-0718.patch"))
(sha256
(base32
- "11pblz61zyxh68s5pdcbhc30ha1b2vfjd83aiwfg4vc15x3hadw2"))
- (patches (search-patches "expat-CVE-2015-1283.patch"))))
+ "0ryyjgvy7jq0qb7a9mhc1giy3bzn56aiwrs8dpydqngplbjq9xdg"))))
(build-system gnu-build-system)
(home-page "http://www.libexpat.org/")
(synopsis "Stream-oriented XML parser library written in C")