components/libxml2/patches/10.CVE-2011-0216.patch
author Ben Chang <Benjamin.Chang@Oracle.COM>
Thu, 26 Jul 2012 10:31:22 -0700
changeset 933 fbf8e08af1f1
parent 624 c33a34e65bdb
permissions -rw-r--r--
7181717 Problem with network/dhcp_server 7187034 ISC DHCP needs to be updated to 4.1-ESV-R6

This patch taken directly from upstream:
http://git.gnome.org/browse/libxml2/commit/?id=69f04562f75212bfcabecd190ea8b06ace28ece2
--- libxml2-2.7.6/encoding.c	Thu Sep 24 08:31:59 2009
+++ libxml2-2.7.6/new.encoding.c	Mon Oct 24 11:11:46 2011
@@ -1771,7 +1771,7 @@
     if (in == NULL) return(-1);
 
     /* calculate space available */
-    written = out->size - out->use;
+    written = out->size - out->use - 1; /* count '\0' */
     toconv = in->use;
     /*
      * echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38
@@ -1892,7 +1892,7 @@
     toconv = in->use;
     if (toconv == 0)
         return (0);
-    written = out->size - out->use;
+    written = out->size - out->use - 1; /* count '\0' */
     if (toconv * 2 >= written) {
         xmlBufferGrow(out, out->size + toconv * 2);
         written = out->size - out->use - 1;