Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > 07bb25571b9977d601d94b4dbd72c5e3 > files > 3

libxml2-2.7.8-9.4.mga1.src.rpm


https://bugzilla.redhat.com/show_bug.cgi?id=724906
http://git.gnome.org/browse/libxml2/commit/?id=69f04562f75212bfcabecd190ea8b06ace28ece2

--- encoding.c	2010-11-04 16:40:06.000000000 +0000
+++ encoding.c.oden	2011-12-15 14:42:05.000000000 +0000
@@ -1928,7 +1928,7 @@ xmlCharEncFirstLineInt(xmlCharEncodingHa
     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
@@ -2059,7 +2059,7 @@ xmlCharEncInFunc(xmlCharEncodingHandler
     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;