summaryrefslogtreecommitdiff
path: root/debian/patches/0009-Catch-malloc-error-and-exit-accordingly.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/0009-Catch-malloc-error-and-exit-accordingly.patch')
-rw-r--r--debian/patches/0009-Catch-malloc-error-and-exit-accordingly.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/debian/patches/0009-Catch-malloc-error-and-exit-accordingly.patch b/debian/patches/0009-Catch-malloc-error-and-exit-accordingly.patch
new file mode 100644
index 0000000..3f93a57
--- /dev/null
+++ b/debian/patches/0009-Catch-malloc-error-and-exit-accordingly.patch
@@ -0,0 +1,24 @@
+From: Daniel Veillard <veillard@redhat.com>
+Date: Thu, 11 Jul 2013 15:41:22 +0800
+Subject: Catch malloc error and exit accordingly
+
+As pointed privately by Bill Parker <wp02855@gmail.com>
+---
+ xmllint.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/xmllint.c b/xmllint.c
+index c0196ab..4d464e4 100644
+--- a/xmllint.c
++++ b/xmllint.c
+@@ -3090,6 +3090,10 @@ static void usage(const char *name) {
+ static void registerNode(xmlNodePtr node)
+ {
+ node->_private = malloc(sizeof(long));
++ if (node->_private == NULL) {
++ fprintf(stderr, "Out of memory in xmllint:registerNode()\n");
++ exit(XMLLINT_ERR_MEM);
++ }
+ *(long*)node->_private = (long) 0x81726354;
+ nbregister++;
+ }