summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Hommey <glandium@debian.org>2008-03-05 23:42:30 +0100
committerMike Hommey <glandium@debian.org>2008-03-05 23:42:30 +0100
commit729c7fcf0cad48e02744aefa694892b3761d4e4f (patch)
tree1fc22a413c3fdfe5037228439fa4566d740d4b4c
parent63afea9fc5bf75f1e65aedcddb26a20a26666bca (diff)
downloadlibxml2-729c7fcf0cad48e02744aefa694892b3761d4e4f.tar.gz
* error.c: Don't grow error buffer indefinitely when vsnprintf returns -1,
which, if it happens, on glibc-based systems, will happen indefinitely. Closes: #456653.
-rw-r--r--debian/changelog3
-rw-r--r--error.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/debian/changelog b/debian/changelog
index 827313f..d76b9a6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ libxml2 (2.6.31.dfsg-2) UNRELEASED; urgency=low
* xstc/Makefile.am, xstc/Makefile.in: Properly clean generated files.
* nanohttp.c: Apply fix from svn revision 3685 to allocate enough memory
for the Host HTTP header when containing a port number. Closes: #464173.
+ * error.c: Don't grow error buffer indefinitely when vsnprintf returns -1,
+ which, if it happens, on glibc-based systems, will happen indefinitely.
+ Closes: #456653.
-- Mike Hommey <glandium@debian.org> Tue, 04 Mar 2008 22:36:28 +0100
diff --git a/error.c b/error.c
index 722ffbb..89c01e3 100644
--- a/error.c
+++ b/error.c
@@ -45,7 +45,7 @@ void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
if (chars > -1) \
size += chars + 1; \
else \
- size += 100; \
+ break; \
if ((larger = (char *) xmlRealloc(str, size)) == NULL) {\
break; \
} \