summaryrefslogtreecommitdiff
path: root/debian/patches/0010-Avoid-crash-if-allocation-fails.patch
diff options
context:
space:
mode:
authorAron Xu <aron@debian.org>2014-07-09 05:15:30 +0800
committerAron Xu <aron@debian.org>2014-07-09 06:46:14 +0800
commitad8b2111a0e5330aca1739fcf35658376b2970a8 (patch)
treeda383c6f40e6b4ed3608a6563dc7bbb7f10ccbf2 /debian/patches/0010-Avoid-crash-if-allocation-fails.patch
parent20b6bde61412aea3ba50fee9ad679a422cfff3ff (diff)
downloadlibxml2-ad8b2111a0e5330aca1739fcf35658376b2970a8.tar.gz
New round of cherry-picking upstream fixes
Diffstat (limited to 'debian/patches/0010-Avoid-crash-if-allocation-fails.patch')
-rw-r--r--debian/patches/0010-Avoid-crash-if-allocation-fails.patch25
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/patches/0010-Avoid-crash-if-allocation-fails.patch b/debian/patches/0010-Avoid-crash-if-allocation-fails.patch
new file mode 100644
index 0000000..e4e7206
--- /dev/null
+++ b/debian/patches/0010-Avoid-crash-if-allocation-fails.patch
@@ -0,0 +1,25 @@
+From: Daniel Veillard <veillard@redhat.com>
+Date: Mon, 22 Jul 2013 14:28:20 +0800
+Subject: Avoid crash if allocation fails
+
+https://bugzilla.gnome.org/show_bug.cgi?id=704527
+xmlSchemaNewValue() may fail on OOM error
+---
+ xmlschemastypes.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/xmlschemastypes.c b/xmlschemastypes.c
+index a9edc03..ec403e8 100644
+--- a/xmlschemastypes.c
++++ b/xmlschemastypes.c
+@@ -242,6 +242,10 @@ xmlSchemaNewMinLengthFacet(int value)
+ }
+ ret->type = XML_SCHEMA_FACET_MINLENGTH;
+ ret->val = xmlSchemaNewValue(XML_SCHEMAS_NNINTEGER);
++ if (ret->val == NULL) {
++ xmlFree(ret);
++ return(NULL);
++ }
+ ret->val->value.decimal.lo = value;
+ return (ret);
+ }