summaryrefslogtreecommitdiff
path: root/debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2015-08-25 22:26:52 +0200
committerRaphaël Hertzog <hertzog@debian.org>2015-08-25 22:26:52 +0200
commit3b14c3fd6410716d407178e48972b1c1bea48c29 (patch)
tree232c9c894b45099f211728742569111738b17e16 /debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch
parentedefea9d480751896e380c7bfc92517c9e39039d (diff)
downloadlibxml2-3b14c3fd6410716d407178e48972b1c1bea48c29.tar.gz
Revert "Remove no-longer-needed upstream patches"
This reverts commit 4a5e25fad6693afda89b3826f73e83d826618863.
Diffstat (limited to 'debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch')
-rw-r--r--debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch27
1 files changed, 27 insertions, 0 deletions
diff --git a/debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch b/debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch
new file mode 100644
index 0000000..e1a2197
--- /dev/null
+++ b/debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch
@@ -0,0 +1,27 @@
+From: Daniel Veillard <veillard@redhat.com>
+Date: Wed, 8 May 2013 05:45:48 +0000
+Subject: xmllint --memory should fail on empty files
+
+Exposed by https://bugzilla.gnome.org/show_bug.cgi?id=699896
+when doing analysis but a priori unrelated.
+---
+ xmllint.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/xmllint.c b/xmllint.c
+index 26d8db1..c0196ab 100644
+--- a/xmllint.c
++++ b/xmllint.c
+@@ -2338,8 +2338,11 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
+ if ((fd = open(filename, O_RDONLY)) < 0)
+ return;
+ base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
+- if (base == (void *) MAP_FAILED)
++ if (base == (void *) MAP_FAILED) {
++ fprintf(stderr, "mmap failure for file %s\n", filename);
++ progresult = XMLLINT_ERR_RDFILE;
+ return;
++ }
+
+ if (rectxt == NULL)
+ doc = xmlReadMemory((char *) base, info.st_size,