~ubuntu-branches/ubuntu/wily/libxml2/wily-proposed

« back to all changes in this revision

Viewing changes to debian/patches/0011-Avoid-crash-if-allocation-fails.patch

  • Committer: Package Import Robot
  • Author(s): Aron Xu
  • Date: 2014-10-26 07:04:50 UTC
  • mfrom: (43.2.7 sid)
  • Revision ID: package-import@ubuntu.com-20141026070450-rmcqvcqn8peeuebs
Tags: 2.9.2+dfsg1-1
* New upstream release (Closes: #765722, CVE-2014-3660)
* Remove no-longer-needed upstream patches
* Update distro patch
* Std-ver: 3.9.5 -> 3.9.6, no change.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: Daniel Veillard <veillard@redhat.com>
2
 
Date: Mon, 22 Jul 2013 14:28:20 +0800
3
 
Subject: Avoid crash if allocation fails
4
 
 
5
 
https://bugzilla.gnome.org/show_bug.cgi?id=704527
6
 
xmlSchemaNewValue() may fail on OOM error
7
 
---
8
 
 xmlschemastypes.c |    4 ++++
9
 
 1 file changed, 4 insertions(+)
10
 
 
11
 
diff --git a/xmlschemastypes.c b/xmlschemastypes.c
12
 
index a9edc03..ec403e8 100644
13
 
--- a/xmlschemastypes.c
14
 
+++ b/xmlschemastypes.c
15
 
@@ -242,6 +242,10 @@ xmlSchemaNewMinLengthFacet(int value)
16
 
     }
17
 
     ret->type = XML_SCHEMA_FACET_MINLENGTH;
18
 
     ret->val = xmlSchemaNewValue(XML_SCHEMAS_NNINTEGER);
19
 
+    if (ret->val == NULL) {
20
 
+        xmlFree(ret);
21
 
+       return(NULL);
22
 
+    }
23
 
     ret->val->value.decimal.lo = value;
24
 
     return (ret);
25
 
 }