summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorAron Xu <aron@debian.org>2014-07-09 04:27:54 +0800
committerAron Xu <aron@debian.org>2014-07-09 04:27:54 +0800
commit580a40ad256a84a87c3d8d4e4dbe9da5b0b5262f (patch)
tree8da1a2728c5e429ad58901f7a271d247e67913b4 /debian
parent6ffdf3fe4e53679d336b70ae83f5bcc7edb3ec6d (diff)
downloadlibxml2-580a40ad256a84a87c3d8d4e4dbe9da5b0b5262f.tar.gz
Fix xmllit crash when --pretty is specified (LP: #923671)
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch34
-rw-r--r--debian/patches/series1
2 files changed, 35 insertions, 0 deletions
diff --git a/debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch b/debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch
new file mode 100644
index 0000000..f654008
--- /dev/null
+++ b/debian/patches/0008-xmllint-pretty-crashed-without-following-numeric-arg.patch
@@ -0,0 +1,34 @@
+From: Tim Galeckas <tim@galeckas.com>
+Date: Thu, 29 Aug 2013 16:44:33 +0800
+Subject: xmllint --pretty crashed without following numeric argument
+
+https://bugzilla.gnome.org/show_bug.cgi?id=674789
+
+We need to check for NULL argument before calling atoi()
+---
+ xmllint.c | 12 +++++++-----
+ 1 file changed, 7 insertions(+), 5 deletions(-)
+
+diff --git a/xmllint.c b/xmllint.c
+index c0196ab..506bff9 100644
+--- a/xmllint.c
++++ b/xmllint.c
+@@ -3375,11 +3375,13 @@ main(int argc, char **argv) {
+ (!strcmp(argv[i], "--pretty"))) {
+ i++;
+ #ifdef LIBXML_OUTPUT_ENABLED
+- format = atoi(argv[i]);
+- if (format == 1) {
+- noblanks++;
+- xmlKeepBlanksDefault(0);
+- }
++ if (argv[i] != NULL) {
++ format = atoi(argv[i]);
++ if (format == 1) {
++ noblanks++;
++ xmlKeepBlanksDefault(0);
++ }
++ }
+ #endif /* LIBXML_OUTPUT_ENABLED */
+ }
+ #ifdef LIBXML_READER_ENABLED
diff --git a/debian/patches/series b/debian/patches/series
index cae4aea..4dae346 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
0005-properly-quote-the-namespace-uris-written-out-during.patch
0006-Fix-a-parsing-bug-on-non-ascii-element-and-CR-LF-usa.patch
0007-Fix-XPath-optimization-with-predicates.patch
+0008-xmllint-pretty-crashed-without-following-numeric-arg.patch