diff options
author | James Cook <jcook@cs.berkeley.edu> | 2016-05-18 08:30:06 -0700 |
---|---|---|
committer | James Cook <jcook@cs.berkeley.edu> | 2016-05-18 08:30:06 -0700 |
commit | 35c0d1aba8fa0d90366e6e2817c6638bfd0a9e6f (patch) | |
tree | d45b5b8b892ed166e77f475c163b6dc58b6c0edc /pkgs | |
parent | a7ca56428afaca9527b6be9026872b5c180482cd (diff) | |
parent | 66580778153da0ec5ebf3b845b753d8e3288dfb5 (diff) |
Merge pull request #15526 from rycee/bump/expat
expat: 2.1.0 -> 2.1.1
Diffstat (limited to 'pkgs')
-rw-r--r-- | pkgs/development/libraries/expat/CVE-2015-1283.patch | 77 | ||||
-rw-r--r-- | pkgs/development/libraries/expat/default.nix | 10 |
2 files changed, 5 insertions, 82 deletions
diff --git a/pkgs/development/libraries/expat/CVE-2015-1283.patch b/pkgs/development/libraries/expat/CVE-2015-1283.patch deleted file mode 100644 index 33b975912d400..0000000000000 --- a/pkgs/development/libraries/expat/CVE-2015-1283.patch +++ /dev/null @@ -1,77 +0,0 @@ -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) { - - - - diff --git a/pkgs/development/libraries/expat/default.nix b/pkgs/development/libraries/expat/default.nix index 774190278cb31..bc1801ef804f8 100644 --- a/pkgs/development/libraries/expat/default.nix +++ b/pkgs/development/libraries/expat/default.nix @@ -1,15 +1,13 @@ { stdenv, fetchurl }: stdenv.mkDerivation rec { - name = "expat-2.1.0"; + name = "expat-2.1.1"; src = fetchurl { - url = "mirror://sourceforge/expat/${name}.tar.gz"; - sha256 = "11pblz61zyxh68s5pdcbhc30ha1b2vfjd83aiwfg4vc15x3hadw2"; + url = "mirror://sourceforge/expat/${name}.tar.bz2"; + sha256 = "0ryyjgvy7jq0qb7a9mhc1giy3bzn56aiwrs8dpydqngplbjq9xdg"; }; - patches = [ ./CVE-2015-1283.patch ]; - outputs = [ "dev" "out" ]; # TODO: fix referrers outputBin = "dev"; @@ -17,6 +15,8 @@ stdenv.mkDerivation rec { outputMan = "dev"; # tiny page for a dev tool + doCheck = true; + meta = with stdenv.lib; { homepage = http://www.libexpat.org/; description = "A stream-oriented XML parser library written in C"; |