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

« back to all changes in this revision

Viewing changes to xmllint.c

  • 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
  • mfrom: (43.2.6 sid)
  • Revision ID: package-import@ubuntu.com-20140709054015-1q7dyagza4p2gkm0
Tags: 2.9.1+dfsg1-4
[ 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:
1837
1837
        if ((fd = open(filename, O_RDONLY)) < 0)
1838
1838
            return;
1839
1839
        base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
1840
 
        if (base == (void *) MAP_FAILED)
 
1840
        if (base == (void *) MAP_FAILED) {
 
1841
            close(fd);
 
1842
            fprintf(stderr, "mmap failure for file %s\n", filename);
 
1843
            progresult = XMLLINT_ERR_RDFILE;
1841
1844
            return;
 
1845
        }
1842
1846
 
1843
1847
        reader = xmlReaderForMemory(base, info.st_size, filename,
1844
1848
                                    NULL, options);
2223
2227
        if ((fd = open(filename, O_RDONLY)) < 0)
2224
2228
            return;
2225
2229
        base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
2226
 
        if (base == (void *) MAP_FAILED)
 
2230
        if (base == (void *) MAP_FAILED) {
 
2231
            close(fd);
 
2232
            fprintf(stderr, "mmap failure for file %s\n", filename);
 
2233
            progresult = XMLLINT_ERR_RDFILE;
2227
2234
            return;
 
2235
        }
2228
2236
 
2229
2237
        doc = htmlReadMemory((char *) base, info.st_size, filename,
2230
2238
                             NULL, options);
2339
2347
                return;
2340
2348
            base = mmap(NULL, info.st_size, PROT_READ, MAP_SHARED, fd, 0) ;
2341
2349
            if (base == (void *) MAP_FAILED) {
 
2350
                close(fd);
2342
2351
                fprintf(stderr, "mmap failure for file %s\n", filename);
2343
2352
                progresult = XMLLINT_ERR_RDFILE;
2344
2353
                return;
2564
2573
                    fprintf(stderr, "Failed to canonicalize\n");
2565
2574
                    progresult = XMLLINT_ERR_OUT;
2566
2575
                }
2567
 
            } else if (canonical) {
 
2576
            } else if (canonical_11) {
2568
2577
                xmlChar *result = NULL;
2569
2578
                int size;
2570
2579
 
3090
3099
static void registerNode(xmlNodePtr node)
3091
3100
{
3092
3101
    node->_private = malloc(sizeof(long));
 
3102
    if (node->_private == NULL) {
 
3103
        fprintf(stderr, "Out of memory in xmllint:registerNode()\n");
 
3104
        exit(XMLLINT_ERR_MEM);
 
3105
    }
3093
3106
    *(long*)node->_private = (long) 0x81726354;
3094
3107
    nbregister++;
3095
3108
}