~ubuntu-branches/ubuntu/utopic/libxml2/utopic

« back to all changes in this revision

Viewing changes to debian/patches/0005-xmllint-memory-should-fail-on-empty-files.patch

  • Committer: Package Import Robot
  • Author(s): Aron Xu, Christian Svensson, Daniel Schepler, Helmut Grohne, Adam Conrad, Matthias Klose, Aron Xu
  • Date: 2014-07-09 05:40:15 UTC
  • mto: This revision was merged to the branch mainline in revision 75.
  • Revision ID: package-import@ubuntu.com-20140709054015-rdnfjxrf3zvmw6l7
[ Christian Svensson ]
* Do not build-depend on readline (Closes: #742350)

[ Daniel Schepler ]
* Patch to bootstrap without python (Closes: #738080)

[ Helmut Grohne ]
* Drop unneeded B-D on perl and binutils (Closes: #753005)

[ Adam Conrad ]
* Actually run dh_autoreconf, which the old/new mixed rules file misses.

[ Matthias Klose ]
* Add patch to fix python multiarch issue
* Allow the package to cross-build by tweaking B-Ds on python
* Set PYTHON_LIBS for cross builds

[ Aron Xu ]
* Use correct $CC
* Configure udeb without python
* New round of cherry-picking upstream fixes
  - Includes fixes for CVE-2014-0191 (Closes: #747309).
* Call prename with -vf
* Require python-all-dev (>= 2.7.5-5~)
* Bump std-ver: 3.9.4 -> 3.9.5, no change

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
4
 
 
5
Exposed by https://bugzilla.gnome.org/show_bug.cgi?id=699896
 
6
when doing analysis but a priori unrelated.
 
7
---
 
8
 xmllint.c |    5 ++++-
 
9
 1 file changed, 4 insertions(+), 1 deletion(-)
 
10
 
 
11
diff --git a/xmllint.c b/xmllint.c
 
12
index 26d8db1..c0196ab 100644
 
13
--- a/xmllint.c
 
14
+++ b/xmllint.c
 
15
@@ -2338,8 +2338,11 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
 
16
            if ((fd = open(filename, O_RDONLY)) < 0)
 
17
                return;
 
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;
 
23
                return;
 
24
+           }
 
25
 
 
26
            if (rectxt == NULL)
 
27
                doc = xmlReadMemory((char *) base, info.st_size,