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

« back to all changes in this revision

Viewing changes to xzlib.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
  • 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:
245
245
    return 0;
246
246
}
247
247
 
 
248
#ifdef HAVE_ZLIB_H
 
249
static int
 
250
xz_avail_zstrm(xz_statep state)
 
251
{
 
252
    int ret;
 
253
    state->strm.avail_in = state->zstrm.avail_in;
 
254
    state->strm.next_in = state->zstrm.next_in;
 
255
    ret = xz_avail(state);
 
256
    state->zstrm.avail_in = (uInt) state->strm.avail_in;
 
257
    state->zstrm.next_in = (Bytef *) state->strm.next_in;
 
258
    return ret;
 
259
}
 
260
#endif
 
261
 
248
262
static int
249
263
is_format_xz(xz_statep state)
250
264
{
314
328
#define NEXT() ((strm->avail_in == 0 && xz_avail(state) == -1) ? -1 : \
315
329
                (strm->avail_in == 0 ? -1 : \
316
330
                 (strm->avail_in--, *(strm->next_in)++)))
 
331
/* Same thing, but from zstrm */
 
332
#define NEXTZ() ((strm->avail_in == 0 && xz_avail_zstrm(state) == -1) ? -1 : \
 
333
                (strm->avail_in == 0 ? -1 : \
 
334
                 (strm->avail_in--, *(strm->next_in)++)))
317
335
 
318
336
/* Get a four-byte little-endian integer and return 0 on success and the value
319
337
   in *ret.  Otherwise -1 is returned and *ret is not modified. */
324
342
    unsigned long val;
325
343
    z_streamp strm = &(state->zstrm);
326
344
 
327
 
    val = NEXT();
328
 
    val += (unsigned) NEXT() << 8;
329
 
    val += (unsigned long) NEXT() << 16;
330
 
    ch = NEXT();
 
345
    val = NEXTZ();
 
346
    val += (unsigned) NEXTZ() << 8;
 
347
    val += (unsigned long) NEXTZ() << 16;
 
348
    ch = NEXTZ();
331
349
    if (ch == -1)
332
350
        return -1;
333
351
    val += (unsigned long) ch << 24;