diff -Nru libcompress-raw-zlib-perl-2.069/Changes libcompress-raw-zlib-perl-2.072/Changes --- libcompress-raw-zlib-perl-2.069/Changes 2015-09-26 18:37:10.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/Changes 2017-02-12 16:09:39.000000000 +0000 @@ -1,6 +1,35 @@ CHANGES ------- + 2.072 12 Feb 2017 + + * Makefile.PL + #120084: Need Fix for Makefile.PL depending on . in @INC + + * zlib-src + #120207: inflateUndermine: subvert arg conditionally used/unused + + * zlib-src + #112829: two gcc6-found problems + + * fix deflateParams for zlib > 1.2.8 + #119762: Tests broken with zlib-1.2.10 + + 2.071 30 Dec 2016 + + * #119580 (inflate.c: One (last?) compilation warning) + Identical issue reeported in upstream zlib + https://github.com/madler/zlib/issues/111 + + Fix checked into zlib dev codeline via + https://github.com/madler/zlib/commit/2edb94a3025d288dc251bc6cbb2c02e60fbd7438 + + 2.070 28 Dec 2016 + + * #107642: compilation warning from inflate.c + + * #119007: [PATCH] Wrong FLAG_APPEND logic analog to Bzip2 + 2.069 26 Sept 2015 * reduce compiler warnings and stderr noise diff -Nru libcompress-raw-zlib-perl-2.069/debian/changelog libcompress-raw-zlib-perl-2.072/debian/changelog --- libcompress-raw-zlib-perl-2.069/debian/changelog 2016-10-24 09:14:47.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/debian/changelog 2017-02-17 10:06:54.000000000 +0000 @@ -1,3 +1,16 @@ +libcompress-raw-zlib-perl (2.072-0ubuntu1) zesty; urgency=medium + + * New upstream release + * Fix build/test failure with zlib 1.2.11. + + -- Dimitri John Ledkov Fri, 17 Feb 2017 10:06:08 +0000 + +libcompress-raw-zlib-perl (2.069-1build3) zesty; urgency=medium + + * No-change rebuild for zlib 1.2.11. + + -- Dimitri John Ledkov Fri, 17 Feb 2017 09:25:58 +0000 + libcompress-raw-zlib-perl (2.069-1build2) zesty; urgency=medium * No-change rebuild for perl 5.24 transition diff -Nru libcompress-raw-zlib-perl-2.069/debian/control libcompress-raw-zlib-perl-2.072/debian/control --- libcompress-raw-zlib-perl-2.069/debian/control 2015-10-05 15:57:46.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/debian/control 2017-02-17 10:06:57.000000000 +0000 @@ -1,5 +1,6 @@ Source: libcompress-raw-zlib-perl -Maintainer: Debian Perl Group +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian Perl Group Uploaders: Krzysztof Krzyzaniak (eloy) , Damyan Ivanov , gregor herrmann , diff -Nru libcompress-raw-zlib-perl-2.069/lib/Compress/Raw/Zlib.pm libcompress-raw-zlib-perl-2.072/lib/Compress/Raw/Zlib.pm --- libcompress-raw-zlib-perl-2.069/lib/Compress/Raw/Zlib.pm 2015-09-26 18:34:29.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/lib/Compress/Raw/Zlib.pm 2017-02-12 15:44:42.000000000 +0000 @@ -10,7 +10,7 @@ use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD, %DEFLATE_CONSTANTS, @DEFLATE_CONSTANTS); -$VERSION = '2.069'; +$VERSION = '2.072'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @@ -1568,21 +1568,21 @@ L For RFC 1950, 1951 and 1952 see -F, -F and -F +L, +L and +L The I compression library was written by Jean-loup Gailly -F and Mark Adler F. +C and Mark Adler C. The primary site for the I compression library is -F. +L. -The primary site for gzip is F. +The primary site for gzip is L. =head1 AUTHOR -This module was written by Paul Marquess, F. +This module was written by Paul Marquess, C. =head1 MODIFICATION HISTORY @@ -1590,7 +1590,7 @@ =head1 COPYRIGHT AND LICENSE -Copyright (c) 2005-2015 Paul Marquess. All rights reserved. +Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. diff -Nru libcompress-raw-zlib-perl-2.069/Makefile.PL libcompress-raw-zlib-perl-2.072/Makefile.PL --- libcompress-raw-zlib-perl-2.069/Makefile.PL 2014-02-02 19:26:41.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/Makefile.PL 2017-02-04 18:22:31.000000000 +0000 @@ -3,6 +3,7 @@ use strict ; require 5.006 ; +use lib '.'; use private::MakeUtil; use ExtUtils::MakeMaker 5.16 ; use ExtUtils::Install (); # only needed to check for version diff -Nru libcompress-raw-zlib-perl-2.069/META.json libcompress-raw-zlib-perl-2.072/META.json --- libcompress-raw-zlib-perl-2.069/META.json 2015-09-26 18:37:32.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/META.json 2017-02-12 16:12:24.000000000 +0000 @@ -4,7 +4,7 @@ "unknown" ], "dynamic_config" : 1, - "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112150", + "generated_by" : "ExtUtils::MakeMaker version 7.1001, CPAN::Meta::Converter version 2.150005", "license" : [ "perl_5" ], @@ -24,12 +24,12 @@ "prereqs" : { "build" : { "requires" : { - "ExtUtils::MakeMaker" : 0 + "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { - "ExtUtils::MakeMaker" : 0 + "ExtUtils::MakeMaker" : "0" } }, "runtime" : { @@ -37,5 +37,6 @@ } }, "release_status" : "stable", - "version" : "2.069" + "version" : "2.072", + "x_serialization_backend" : "JSON::PP version 2.27300" } diff -Nru libcompress-raw-zlib-perl-2.069/META.yml libcompress-raw-zlib-perl-2.072/META.yml --- libcompress-raw-zlib-perl-2.069/META.yml 2015-09-26 18:37:32.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/META.yml 2017-02-12 16:12:24.000000000 +0000 @@ -3,15 +3,15 @@ author: - unknown build_requires: - ExtUtils::MakeMaker: 0 + ExtUtils::MakeMaker: '0' configure_requires: - ExtUtils::MakeMaker: 0 + ExtUtils::MakeMaker: '0' dynamic_config: 1 -generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.112150' +generated_by: 'ExtUtils::MakeMaker version 7.1001, CPAN::Meta::Converter version 2.150005' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 + version: '1.4' name: Compress-Raw-Zlib no_index: directory: @@ -20,4 +20,5 @@ - t - private requires: {} -version: 2.069 +version: '2.072' +x_serialization_backend: 'CPAN::Meta::YAML version 0.018' diff -Nru libcompress-raw-zlib-perl-2.069/README libcompress-raw-zlib-perl-2.072/README --- libcompress-raw-zlib-perl-2.069/README 2015-09-26 18:34:29.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/README 2017-02-12 15:44:42.000000000 +0000 @@ -1,11 +1,11 @@ Compress-Raw-Zlib - Version 2.069 + Version 2.072 - 26th September 2015 + 12th February 2017 - Copyright (c) 2005-2015 Paul Marquess. All rights reserved. + Copyright (c) 2005-2017 Paul Marquess. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -355,7 +355,7 @@ If you haven't installed Compress-Raw-Zlib then search Compress::Raw::Zlib.pm for a line like this: - $VERSION = "2.069" ; + $VERSION = "2.072" ; c. The version of zlib you have used. If you have successfully installed Compress-Raw-Zlib, this one-liner diff -Nru libcompress-raw-zlib-perl-2.069/t/000prereq.t libcompress-raw-zlib-perl-2.072/t/000prereq.t --- libcompress-raw-zlib-perl-2.069/t/000prereq.t 2015-09-26 13:56:45.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/t/000prereq.t 2017-02-12 11:50:23.000000000 +0000 @@ -19,7 +19,7 @@ if eval { require Test::NoWarnings ; import Test::NoWarnings; 1 }; - my $VERSION = '2.069'; + my $VERSION = '2.072'; my @NAMES = qw( ); diff -Nru libcompress-raw-zlib-perl-2.069/t/02zlib.t libcompress-raw-zlib-perl-2.072/t/02zlib.t --- libcompress-raw-zlib-perl-2.069/t/02zlib.t 2014-01-30 20:52:56.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/t/02zlib.t 2017-02-12 11:50:23.000000000 +0000 @@ -27,7 +27,7 @@ $count = 232 ; } elsif ($] >= 5.006) { - $count = 317 ; + $count = 320 ; } else { $count = 275 ; @@ -559,6 +559,13 @@ is $x->get_Level(), Z_BEST_SPEED; is $x->get_Strategy(), Z_HUFFMAN_ONLY; + # change both Level & Strategy again without any calls to deflate + $status = $x->deflateParams(-Level => Z_DEFAULT_COMPRESSION, -Strategy => Z_DEFAULT_STRATEGY, -Bufsize => 1234) ; + cmp_ok $status, '==', Z_OK ; + + is $x->get_Level(), Z_DEFAULT_COMPRESSION; + is $x->get_Strategy(), Z_DEFAULT_STRATEGY; + $status = $x->deflate($goodbye, $Answer) ; cmp_ok $status, '==', Z_OK ; $input .= $goodbye; @@ -568,7 +575,7 @@ cmp_ok $status, '==', Z_OK ; is $x->get_Level(), Z_NO_COMPRESSION; - is $x->get_Strategy(), Z_HUFFMAN_ONLY; + is $x->get_Strategy(), Z_DEFAULT_STRATEGY; $status = $x->deflate($goodbye, $Answer) ; cmp_ok $status, '==', Z_OK ; diff -Nru libcompress-raw-zlib-perl-2.069/t/compress/CompTestUtils.pm libcompress-raw-zlib-perl-2.072/t/compress/CompTestUtils.pm --- libcompress-raw-zlib-perl-2.069/t/compress/CompTestUtils.pm 2014-02-01 12:03:01.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/t/compress/CompTestUtils.pm 2017-02-12 12:11:48.000000000 +0000 @@ -70,8 +70,8 @@ our ($index); $index = '00000'; - our ($useTempFile) = defined &File::Temp::tempdir; - our ($useTempDir) = defined &File::Temp::newdir; + our ($useTempFile); + our ($useTempDir); sub new { diff -Nru libcompress-raw-zlib-perl-2.069/zlib-src/inflate.c libcompress-raw-zlib-perl-2.072/zlib-src/inflate.c --- libcompress-raw-zlib-perl-2.069/zlib-src/inflate.c 2015-09-24 22:22:43.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/zlib-src/inflate.c 2017-02-11 18:00:20.000000000 +0000 @@ -1494,6 +1494,7 @@ state->sane = !subvert; return Z_OK; #else + (void)subvert; state->sane = 1; return Z_DATA_ERROR; #endif @@ -1504,7 +1505,11 @@ { struct inflate_state FAR *state; - if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16; + /* Change to return statement below is taken from + https://github.com/madler/zlib/commit/2edb94a3025d288dc251bc6cbb2c02e60fbd7438 + */ + if (strm == Z_NULL || strm->state == Z_NULL) + return -(1L << 16); state = (struct inflate_state FAR *)strm->state; return ((long)(state->back) << 16) + (state->mode == COPY ? state->length : diff -Nru libcompress-raw-zlib-perl-2.069/Zlib.xs libcompress-raw-zlib-perl-2.072/Zlib.xs --- libcompress-raw-zlib-perl-2.069/Zlib.xs 2015-09-24 22:30:01.000000000 +0000 +++ libcompress-raw-zlib-perl-2.072/Zlib.xs 2017-02-12 11:25:22.000000000 +0000 @@ -74,6 +74,10 @@ # define AT_LEAST_ZLIB_1_2_8 #endif +#if defined(ZLIB_VERNUM) && ZLIB_VERNUM >= 0x1290 +# define AT_LEAST_ZLIB_1_2_9 +#endif + #ifdef USE_PPPORT_H # define NEED_sv_2pvbyte # define NEED_sv_2pv_nolen @@ -134,12 +138,13 @@ uLong dict_adler ; int last_error ; bool zip_mode ; -#define SETP_BYTE +/* #define SETP_BYTE */ #ifdef SETP_BYTE + /* SETP_BYTE only works with zlib up to 1.2.8 */ bool deflateParams_out_valid ; Bytef deflateParams_out_byte; #else -#define deflateParams_BUFFER_SIZE 0x4000 +#define deflateParams_BUFFER_SIZE 0x40000 uLong deflateParams_out_length; Bytef* deflateParams_out_buffer; #endif @@ -636,6 +641,103 @@ return sv ; } +#if 0 +int +flushToBuffer(di_stream* s, int flush) +{ + dTHX; + int ret ; + z_stream * strm = &s->stream; + + Bytef* output = s->deflateParams_out_buffer ; + + strm->next_in = NULL; + strm->avail_in = 0; + + uLong total_output = 0; + uLong have = 0; + + do + { + if (output) + output = (unsigned char *)saferealloc(output, total_output + s->bufsize); + else + output = (unsigned char *)safemalloc(s->bufsize); + + strm->next_out = output + total_output; + strm->avail_out = s->bufsize; + + ret = deflate(strm, flush); /* no bad return value */ + //assert(ret != Z_STREAM_ERROR); /* state not clobbered */ + if(ret == Z_STREAM_ERROR) + { + safefree(output); + return ret; + } + have = s->bufsize - strm->avail_out; + total_output += have; + + //fprintf(stderr, "FLUSH %s %d, return %d\n", flush_flags[flush], have, ret); + + } while (strm->avail_out == 0); + + s->deflateParams_out_buffer = output; + s->deflateParams_out_length = total_output; + + return Z_OK; +} +#endif + +#ifndef SETP_BYTE +int +flushParams(di_stream* s) +{ + dTHX; + int ret ; + z_stream * strm = &s->stream; + + strm->next_in = NULL; + strm->avail_in = 0; + + Bytef* output = s->deflateParams_out_buffer ; + uLong total_output = s->deflateParams_out_length; + + uLong have = 0; + + do + { + if (output) + output = (unsigned char *)saferealloc(output, total_output + s->bufsize); + else + output = (unsigned char *)safemalloc(s->bufsize); + + strm->next_out = output + total_output; + strm->avail_out = s->bufsize; + + ret = deflateParams(&(s->stream), s->Level, s->Strategy); + /* fprintf(stderr, "deflateParams %d %s %lu\n", ret, + GetErrorString(ret), s->bufsize - strm->avail_out); */ + + if (ret == Z_STREAM_ERROR) + break; + + have = s->bufsize - strm->avail_out; + total_output += have; + + + } while (ret == Z_BUF_ERROR) ; + + if(ret == Z_STREAM_ERROR) + safefree(output); + else + { + s->deflateParams_out_buffer = output; + s->deflateParams_out_length = total_output; + } + + return ret; +} +#endif /* ! SETP_BYTE */ #include "constants.h" @@ -991,20 +1093,24 @@ /* Check for saved output from deflateParams */ if (s->deflateParams_out_length) { uLong plen = s->deflateParams_out_length ; - /* printf("Copy %d bytes saved data\n", plen);*/ + /* printf("Copy %lu bytes saved data\n", plen); */ if (s->stream.avail_out < plen) { - /*printf("GROW from %d to %d\n", s->stream.avail_out, - SvLEN(output) + plen - s->stream.avail_out); */ - Sv_Grow(output, SvLEN(output) + plen - s->stream.avail_out) ; + /* printf("GROW from %d to %lu\n", s->stream.avail_out, + SvLEN(output) + plen - s->stream.avail_out); */ + s->stream.next_out = (Bytef*) Sv_Grow(output, SvLEN(output) + plen - s->stream.avail_out) ; + s->stream.next_out += cur_length; } - Copy(s->stream.next_out, s->deflateParams_out_buffer, plen, Bytef) ; - cur_length = cur_length + plen; + Copy(s->deflateParams_out_buffer, s->stream.next_out, plen, Bytef) ; + cur_length += plen; SvCUR_set(output, cur_length); - s->stream.next_out += plen ; - s->stream.avail_out = SvLEN(output) - cur_length ; - increment = s->stream.avail_out; - s->deflateParams_out_length = 0; + s->stream.next_out += plen ; + s->stream.avail_out = SvLEN(output) - cur_length ; + increment = s->stream.avail_out; + + s->deflateParams_out_length = 0; + Safefree(s->deflateParams_out_buffer); + s->deflateParams_out_buffer = NULL; } #endif RETVAL = Z_OK ; @@ -1027,6 +1133,12 @@ } RETVAL = deflate(&(s->stream), Z_NO_FLUSH); + if (RETVAL != Z_STREAM_ERROR) { + int done = increment - s->stream.avail_out ; + /* printf("std DEFLATEr returned %d '%s' avail in %d, out %d wrote %d\n", RETVAL, + GetErrorString(RETVAL), s->stream.avail_in, +s->stream.avail_out, done); */ + } if (trace) { printf("DEFLATE returned %d %s, avail in %d, out %d\n", RETVAL, @@ -1080,7 +1192,6 @@ CODE: bufinc = s->bufsize; - s->stream.avail_in = 0; /* should be zero already anyway */ /* retrieve the output buffer */ output = deRef_l(output, "flush") ; @@ -1088,7 +1199,7 @@ if (DO_UTF8(output) && !sv_utf8_downgrade(output, 1)) croak("Wide character in Compress::Raw::Zlib::Deflate::flush input parameter"); #endif - if(! s->flags & FLAG_APPEND) { + if((s->flags & FLAG_APPEND) != FLAG_APPEND) { SvCUR_set(output, 0); /* sv_setpvn(output, "", 0); */ } @@ -1108,20 +1219,24 @@ /* Check for saved output from deflateParams */ if (s->deflateParams_out_length) { uLong plen = s->deflateParams_out_length ; - /* printf("Copy %d bytes saved data\n", plen); */ + /* printf("Copy %lu bytes saved data\n", plen); */ if (s->stream.avail_out < plen) { - /* printf("GROW from %d to %d\n", s->stream.avail_out, + /* printf("GROW from %d to %lu\n", s->stream.avail_out, SvLEN(output) + plen - s->stream.avail_out); */ - Sv_Grow(output, SvLEN(output) + plen - s->stream.avail_out) ; + s->stream.next_out = (Bytef*) Sv_Grow(output, SvLEN(output) + plen - s->stream.avail_out) ; + s->stream.next_out += cur_length; } - Copy(s->stream.next_out, s->deflateParams_out_buffer, plen, Bytef) ; - cur_length = cur_length + plen; + Copy(s->deflateParams_out_buffer, s->stream.next_out, plen, Bytef) ; + cur_length += plen; SvCUR_set(output, cur_length); - s->stream.next_out += plen ; - s->stream.avail_out = SvLEN(output) - cur_length ; - increment = s->stream.avail_out; - s->deflateParams_out_length = 0; + s->stream.next_out += plen ; + s->stream.avail_out = SvLEN(output) - cur_length ; + increment = s->stream.avail_out; + + s->deflateParams_out_length = 0; + Safefree(s->deflateParams_out_buffer); + s->deflateParams_out_buffer = NULL; } #endif @@ -1145,9 +1260,15 @@ } RETVAL = deflate(&(s->stream), f); + if (RETVAL != Z_STREAM_ERROR) { + int done = availableout - s->stream.avail_out ; + /* printf("flush DEFLATEr returned %d '%s' avail in %d, out %d wrote %d\n", RETVAL, + GetErrorString(RETVAL), s->stream.avail_in, +s->stream.avail_out, done); */ + } if (trace) { - printf("flush DEFLATE returned %d %s, avail in %d, out %d\n", RETVAL, + printf("flush DEFLATE returned %d '%s', avail in %d, out %d\n", RETVAL, GetErrorString(RETVAL), s->stream.avail_in, s->stream.avail_out); DispStream(s, "AFTER"); } @@ -1184,41 +1305,38 @@ int level int strategy uLong bufsize + bool changed = FALSE; CODE: - /* printf("_deflateParams(Flags %d Level %d Strategy %d Bufsize %d)\n", flags, level, strategy, bufsize); - printf("Before -- Level %d, Strategy %d, Bufsize %d\n", s->Level, s->Strategy, s->bufsize); */ - if (flags & 1) - s->Level = level ; - if (flags & 2) - s->Strategy = strategy ; - if (flags & 4) { + /* printf("_deflateParams(Flags %d Level %d Strategy %d Bufsize %d)\n", flags, level, strategy, bufsize); + printf("Before -- Level %d, Strategy %d, Bufsize %d\n", s->Level, s->Strategy, s->bufsize); */ + if (flags & 1 && level != s->Level) { + s->Level = level ; + changed = TRUE; + } + if (flags & 2 && strategy != s->Strategy) { + s->Strategy = strategy ; + changed = TRUE; + } + if (flags & 4) s->bufsize = bufsize; - } - /* printf("After -- Level %d, Strategy %d, Bufsize %d\n", s->Level, s->Strategy, s->bufsize);*/ + if (changed) { #ifdef SETP_BYTE - s->stream.avail_in = 0; - s->stream.next_out = &(s->deflateParams_out_byte) ; - s->stream.avail_out = 1; - RETVAL = deflateParams(&(s->stream), s->Level, s->Strategy); - s->deflateParams_out_valid = - (RETVAL == Z_OK && s->stream.avail_out == 0) ; - /* printf("RETVAL %d, avail out %d, byte %c\n", RETVAL, s->stream.avail_out, s->deflateParams_out_byte); */ + s->stream.avail_in = 0; + s->stream.next_out = &(s->deflateParams_out_byte) ; + s->stream.avail_out = 1; + RETVAL = deflateParams(&(s->stream), s->Level, s->Strategy); + s->deflateParams_out_valid = + (RETVAL == Z_OK && s->stream.avail_out == 0) ; #else - /* printf("Level %d Strategy %d, Prev Len %d\n", + /* printf("Level %d Strategy %d, Prev Len %d\n", s->Level, s->Strategy, s->deflateParams_out_length); */ - s->stream.avail_in = 0; - if (s->deflateParams_out_buffer == NULL) - s->deflateParams_out_buffer = safemalloc(deflateParams_BUFFER_SIZE); - s->stream.next_out = s->deflateParams_out_buffer ; - s->stream.avail_out = deflateParams_BUFFER_SIZE; - - RETVAL = deflateParams(&(s->stream), s->Level, s->Strategy); - s->deflateParams_out_length = deflateParams_BUFFER_SIZE - s->stream.avail_out; - /* printf("RETVAL %d, length out %d, avail %d\n", - RETVAL, s->deflateParams_out_length, s->stream.avail_out ); */ + RETVAL = flushParams(s); #endif + } + else + RETVAL = Z_OK; OUTPUT: - RETVAL + RETVAL int