1
From: Daniel Veillard <veillard@redhat.com>
2
Date: Wed, 8 May 2013 05:45:48 +0000
3
Subject: xmllint --memory should fail on empty files
5
Exposed by https://bugzilla.gnome.org/show_bug.cgi?id=699896
6
when doing analysis but a priori unrelated.
9
1 file changed, 4 insertions(+), 1 deletion(-)
11
diff --git a/xmllint.c b/xmllint.c
12
index 26d8db1..c0196ab 100644
15
@@ -2338,8 +2338,11 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
16
if ((fd = open(filename, O_RDONLY)) < 0)
18
base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
19
- if (base == (void *) MAP_FAILED)
20
+ if (base == (void *) MAP_FAILED) {
21
+ fprintf(stderr, "mmap failure for file %s\n", filename);
22
+ progresult = XMLLINT_ERR_RDFILE;
27
doc = xmlReadMemory((char *) base, info.st_size,