[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#962234: stretch-pu: package perl/5.24.1-3+deb9u7



Package: release.debian.org
Severity: normal
Tags: stretch
User: release.debian.org@packages.debian.org
Usertags: pu

Upstream released fixes for three regexp-related security issues
on Monday:

https://metacpan.org/pod/release/XSAWYERX/perl-5.28.3/pod/perldelta.pod

The Debian security team would like these as no-dsa, so we would like
to provide them in a point release. The patches have been trivially
backported from 5.28. See #962005.

A FTBFS fix is also included. Please let us know if it's okay to
upload.

Cheers
Dominic.
diff --git a/cpan/IO-Socket-IP/t/01local-client-v4.t b/cpan/IO-Socket-IP/t/01local-client-v4.t
index 7ab7156993..f6aeac4c3b 100644
--- a/cpan/IO-Socket-IP/t/01local-client-v4.t
+++ b/cpan/IO-Socket-IP/t/01local-client-v4.t
@@ -8,7 +8,7 @@ use Test::More;
 use IO::Socket::IP;
 
 use IO::Socket::INET;
-use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in );
+use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in AI_NUMERICHOST );
 
 # Some odd locations like BSD jails might not like INADDR_LOOPBACK. We'll
 # establish a baseline first to test against
@@ -29,12 +29,14 @@ foreach my $socktype (qw( SOCK_STREAM SOCK_DGRAM )) {
       LocalHost => "127.0.0.1",
       Type      => Socket->$socktype,
       Proto     => ( $socktype eq "SOCK_STREAM" ? "tcp" : "udp" ), # Because IO::Socket::INET is stupid and always presumes tcp
+      GetAddrInfoFlags => AI_NUMERICHOST,
    ) or die "Cannot listen on PF_INET - $@";
 
    my $socket = IO::Socket::IP->new(
       PeerHost    => "127.0.0.1",
       PeerService => $testserver->sockport,
       Type        => Socket->$socktype,
+      GetAddrInfoFlags => AI_NUMERICHOST,
    );
 
    ok( defined $socket, "IO::Socket::IP->new constructs a $socktype socket" ) or
diff --git a/cpan/IO-Socket-IP/t/02local-server-v4.t b/cpan/IO-Socket-IP/t/02local-server-v4.t
index c0d349f573..fb711f08bd 100644
--- a/cpan/IO-Socket-IP/t/02local-server-v4.t
+++ b/cpan/IO-Socket-IP/t/02local-server-v4.t
@@ -8,7 +8,7 @@ use Test::More;
 use IO::Socket::IP;
 
 use IO::Socket::INET;
-use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in );
+use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in AI_NUMERICHOST );
 
 # Some odd locations like BSD jails might not like INADDR_LOOPBACK. We'll
 # establish a baseline first to test against
@@ -29,6 +29,7 @@ foreach my $socktype (qw( SOCK_STREAM SOCK_DGRAM )) {
       LocalHost => "127.0.0.1",
       LocalPort => "0",
       Type      => Socket->$socktype,
+      GetAddrInfoFlags => AI_NUMERICHOST,
    );
 
    ok( defined $testserver, "IO::Socket::IP->new constructs a $socktype socket" ) or
diff --git a/cpan/IO-Socket-IP/t/03local-cross-v4.t b/cpan/IO-Socket-IP/t/03local-cross-v4.t
index 8cac72a95b..3e8174ee08 100644
--- a/cpan/IO-Socket-IP/t/03local-cross-v4.t
+++ b/cpan/IO-Socket-IP/t/03local-cross-v4.t
@@ -6,6 +6,7 @@ use warnings;
 use Test::More;
 
 use IO::Socket::IP;
+use Socket qw(AI_NUMERICHOST);
 
 foreach my $socktype (qw( SOCK_STREAM SOCK_DGRAM )) {
    my $testserver = IO::Socket::IP->new(
@@ -13,12 +14,14 @@ foreach my $socktype (qw( SOCK_STREAM SOCK_DGRAM )) {
       LocalHost => "127.0.0.1",
       LocalPort => "0",
       Type      => Socket->$socktype,
+      GetAddrInfoFlags => AI_NUMERICHOST,
    ) or die "Cannot listen on PF_INET - $@";
 
    my $socket = IO::Socket::IP->new(
       PeerHost    => "127.0.0.1",
       PeerService => $testserver->sockport,
       Type        => Socket->$socktype,
+      GetAddrInfoFlags => AI_NUMERICHOST,
    ) or die "Cannot connect on PF_INET - $@";
 
    my $testclient = ( $socktype eq "SOCK_STREAM" ) ? 
diff --git a/cpan/IO-Socket-IP/t/11sockopts.t b/cpan/IO-Socket-IP/t/11sockopts.t
index 90f92ae7bd..856ff28f4e 100644
--- a/cpan/IO-Socket-IP/t/11sockopts.t
+++ b/cpan/IO-Socket-IP/t/11sockopts.t
@@ -8,7 +8,7 @@ use Test::More;
 use IO::Socket::IP;
 
 use Errno qw( EACCES );
-use Socket qw( SOL_SOCKET SO_REUSEADDR SO_REUSEPORT SO_BROADCAST );
+use Socket qw( SOL_SOCKET SO_REUSEADDR SO_REUSEPORT SO_BROADCAST AI_NUMERICHOST);
 
 TODO: {
    local $TODO = "SO_REUSEADDR doesn't appear to work on cygwin smokers" if $^O eq "cygwin";
@@ -21,6 +21,7 @@ TODO: {
       Type      => SOCK_STREAM,
       Listen    => 1,
       ReuseAddr => 1,
+      GetAddrInfoFlags => AI_NUMERICHOST,
    ) or die "Cannot socket() - $@";
 
    ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEADDR ), 'SO_REUSEADDR set' );
@@ -39,6 +40,7 @@ SKIP: {
       Type      => SOCK_STREAM,
       Listen    => 1,
       ReusePort => 1,
+      GetAddrInfoFlags => AI_NUMERICHOST,
    ) or die "Cannot socket() - $@";
 
    ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEPORT ), 'SO_REUSEPORT set' );
@@ -51,6 +53,7 @@ SKIP: {
       LocalHost => "127.0.0.1",
       Type      => SOCK_DGRAM,
       Broadcast => 1,
+      GetAddrInfoFlags => AI_NUMERICHOST,
    );
    skip "Privileges required to set broadcast on datagram socket", 1 if !$sock and $! == EACCES;
    die "Cannot socket() - $@" unless $sock;
diff --git a/cpan/IO-Socket-IP/t/18fdopen.t b/cpan/IO-Socket-IP/t/18fdopen.t
index 20cbe46d47..6843a2c3d2 100644
--- a/cpan/IO-Socket-IP/t/18fdopen.t
+++ b/cpan/IO-Socket-IP/t/18fdopen.t
@@ -6,12 +6,13 @@ use warnings;
 use Test::More;
 
 use IO::Socket::IP;
-use Socket qw( SOCK_STREAM );
+use Socket qw( SOCK_STREAM AI_NUMERICHOST );
 
 my $s1 = IO::Socket::IP->new(
    LocalHost => "127.0.0.1",
    Type      => SOCK_STREAM,
    Listen    => 1,
+   GetAddrInfoFlags => AI_NUMERICHOST,
 ) or die "Cannot listen on AF_INET - $@";
 
 my $s2 = IO::Socket::IP->new;
diff --git a/cpan/IO-Socket-IP/t/20subclass.t b/cpan/IO-Socket-IP/t/20subclass.t
index 231bd52cab..fbc9cff23e 100644
--- a/cpan/IO-Socket-IP/t/20subclass.t
+++ b/cpan/IO-Socket-IP/t/20subclass.t
@@ -6,16 +6,19 @@ use warnings;
 use Test::More;
 
 use IO::Socket::IP;
+use Socket qw( AI_NUMERICHOST );
 
 my $server = IO::Socket::IP->new(
    Listen    => 1,
    LocalHost => "127.0.0.1",
    LocalPort => 0,
+   GetAddrInfoFlags => AI_NUMERICHOST,
 ) or die "Cannot listen on PF_INET - $!";
 
 my $client = IO::Socket::IP->new(
    PeerHost => $server->sockhost,
    PeerPort => $server->sockport,
+   GetAddrInfoFlags => AI_NUMERICHOST,
 ) or die "Cannot connect on PF_INET - $!";
 
 my $accepted = $server->accept( 'MySubclass' )
diff --git a/cpan/IO-Socket-IP/t/21as-inet.t b/cpan/IO-Socket-IP/t/21as-inet.t
index 2b8713d46f..fedb8be538 100644
--- a/cpan/IO-Socket-IP/t/21as-inet.t
+++ b/cpan/IO-Socket-IP/t/21as-inet.t
@@ -6,16 +6,19 @@ use warnings;
 use Test::More;
 
 use IO::Socket::IP;
+use Socket qw( AI_NUMERICHOST );
 
 my $server = IO::Socket::IP->new(
    Listen    => 1,
    LocalHost => "127.0.0.1",
    LocalPort => 0,
+   GetAddrInfoFlags => AI_NUMERICHOST,
 ) or die "Cannot listen on PF_INET - $!";
 
 my $client = IO::Socket::IP->new(
    PeerHost => $server->sockhost,
    PeerPort => $server->sockport,
+   GetAddrInfoFlags => AI_NUMERICHOST,
 ) or die "Cannot connect on PF_INET - $!";
 
 my $accepted = $server->accept
diff --git a/cpan/IO-Socket-IP/t/22timeout.t b/cpan/IO-Socket-IP/t/22timeout.t
index a4c28b3af0..c4a08f5d1f 100644
--- a/cpan/IO-Socket-IP/t/22timeout.t
+++ b/cpan/IO-Socket-IP/t/22timeout.t
@@ -6,17 +6,20 @@ use warnings;
 use Test::More;
 
 use IO::Socket::IP;
+use Socket qw( AI_NUMERICHOST );
 
 my $server = IO::Socket::IP->new(
    Listen    => 1,
    LocalHost => "127.0.0.1",
    LocalPort => 0,
+   GetAddrInfoFlags => AI_NUMERICHOST,
 ) or die "Cannot listen on PF_INET - $!";
 
 my $client = IO::Socket::IP->new(
    PeerHost => $server->sockhost,
    PeerPort => $server->sockport,
    Timeout  => 0.1,
+   GetAddrInfoFlags => AI_NUMERICHOST,
 ) or die "Cannot connect on PF_INET - $!";
 
 ok( defined $client, 'client constructed with Timeout' );
diff --git a/cpan/IO-Socket-IP/t/30nonblocking-connect.t b/cpan/IO-Socket-IP/t/30nonblocking-connect.t
index 518bd2ebd8..ade8349354 100644
--- a/cpan/IO-Socket-IP/t/30nonblocking-connect.t
+++ b/cpan/IO-Socket-IP/t/30nonblocking-connect.t
@@ -8,7 +8,7 @@ use Test::More;
 use IO::Socket::IP;
 
 use IO::Socket::INET;
-use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in );
+use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in AI_NUMERICHOST );
 use Errno qw( EINPROGRESS EWOULDBLOCK );
 
 # Some odd locations like BSD jails might not like INADDR_LOOPBACK. We'll
@@ -27,6 +27,7 @@ my $testserver = IO::Socket::INET->new(
    Listen    => 1,
    LocalHost => "127.0.0.1",
    Type      => SOCK_STREAM,
+   GetAddrInfoFlags => AI_NUMERICHOST,
 ) or die "Cannot listen on PF_INET - $@";
 
 my $socket = IO::Socket::IP->new(
@@ -34,6 +35,7 @@ my $socket = IO::Socket::IP->new(
    PeerService => $testserver->sockport,
    Type        => SOCK_STREAM,
    Blocking    => 0,
+   GetAddrInfoFlags => AI_NUMERICHOST,
 );
 
 ok( defined $socket, 'IO::Socket::IP->new( Blocking => 0 ) constructs a socket' ) or
diff --git a/debian/.git-dpm b/debian/.git-dpm
index 9f7bc9372d..7f785904f5 100644
--- a/debian/.git-dpm
+++ b/debian/.git-dpm
@@ -1,6 +1,6 @@
 # see git-dpm(1) from git-dpm package
-fa594ebedfe64ff2ea2101e07618daeaa9d6e0eb
-fa594ebedfe64ff2ea2101e07618daeaa9d6e0eb
+e5a5e4056884afc8bf630675094fad92e409a30b
+e5a5e4056884afc8bf630675094fad92e409a30b
 13beb365bfa6ab6c49c061bd55769bf272a5e1bf
 13beb365bfa6ab6c49c061bd55769bf272a5e1bf
 perl_5.24.1.orig.tar.xz
diff --git a/debian/changelog b/debian/changelog
index 0920bf60ae..f7884dc6dd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+perl (5.24.1-3+deb9u7) UNRELEASED; urgency=medium
+
+  * Multiple regexp security fixes (Closes: #962005)
+     + [SECURITY] CVE-2020-10543: Buffer overflow caused by a crafted
+       regular expression
+     + [SECURITY] CVE-2020-10878: Integer overflow via malformed bytecode
+       produced by a crafted regular expression
+     + [SECURITY] CVE-2020-12723: Buffer overflow caused by a crafted
+       regular expression
+  * Fix FTBFS with IPv6-only host (Closes: #962019)
+
+ -- Dominic Hargreaves <dom@earth.li>  Wed, 03 Jun 2020 23:54:47 +0100
+
 perl (5.24.1-3+deb9u6) stretch; urgency=medium
 
   * Add backported Time-Local patch by Bernhard M. Wiedemann fixing test
diff --git a/debian/patches/debian/CVE-2016-1238/base-pm-amends-pt2.diff b/debian/patches/debian/CVE-2016-1238/base-pm-amends-pt2.diff
index 17795a6e05..fdfda6a6fc 100644
--- a/debian/patches/debian/CVE-2016-1238/base-pm-amends-pt2.diff
+++ b/debian/patches/debian/CVE-2016-1238/base-pm-amends-pt2.diff
@@ -65,17 +65,17 @@ Origin: upstream, http://perl5.git.perl.org/perl.git/commit/1afa2890005f3acdb579
 Patch-Name: debian/CVE-2016-1238/base-pm-amends-pt2.diff
 ---
  MANIFEST                            |  1 +
- dist/base/lib/base.pm               | 55 +++++++++++++++++++++++++++++++++++--
- dist/base/t/incdot.t                | 55 +++++++++++++++++++++++++++++++++++++
- dist/base/t/lib/BaseIncMandatory.pm |  9 ++++++
- dist/base/t/lib/BaseIncOptional.pm  | 13 +++++++++
+ dist/base/lib/base.pm               | 55 +++++++++++++++++++++++++++--
+ dist/base/t/incdot.t                | 55 +++++++++++++++++++++++++++++
+ dist/base/t/lib/BaseIncMandatory.pm |  9 +++++
+ dist/base/t/lib/BaseIncOptional.pm  | 13 +++++++
  5 files changed, 131 insertions(+), 2 deletions(-)
  create mode 100644 dist/base/t/incdot.t
  create mode 100644 dist/base/t/lib/BaseIncMandatory.pm
  create mode 100644 dist/base/t/lib/BaseIncOptional.pm
 
 diff --git a/MANIFEST b/MANIFEST
-index e4331f166..e6a3dd929 100644
+index e4331f166a..e6a3dd9296 100644
 --- a/MANIFEST
 +++ b/MANIFEST
 @@ -3007,6 +3007,7 @@ dist/base/t/fields-5_6_0.t	See if fields work
@@ -87,7 +87,7 @@ index e4331f166..e6a3dd929 100644
  dist/base/t/lib/Broken.pm	Test module for base.pm
  dist/base/t/lib/Dummy.pm	Test module for base.pm
 diff --git a/dist/base/lib/base.pm b/dist/base/lib/base.pm
-index 6fee6008f..044d138c3 100644
+index 6fee6008fc..044d138c36 100644
 --- a/dist/base/lib/base.pm
 +++ b/dist/base/lib/base.pm
 @@ -6,6 +6,11 @@ use vars qw($VERSION);
@@ -166,7 +166,7 @@ index 6fee6008f..044d138c3 100644
                  #
 diff --git a/dist/base/t/incdot.t b/dist/base/t/incdot.t
 new file mode 100644
-index 000000000..412b2feef
+index 0000000000..412b2feefb
 --- /dev/null
 +++ b/dist/base/t/incdot.t
 @@ -0,0 +1,55 @@
@@ -227,7 +227,7 @@ index 000000000..412b2feef
 +}
 diff --git a/dist/base/t/lib/BaseIncMandatory.pm b/dist/base/t/lib/BaseIncMandatory.pm
 new file mode 100644
-index 000000000..9e0718c60
+index 0000000000..9e0718c60e
 --- /dev/null
 +++ b/dist/base/t/lib/BaseIncMandatory.pm
 @@ -0,0 +1,9 @@
@@ -242,7 +242,7 @@ index 000000000..9e0718c60
 +1;
 diff --git a/dist/base/t/lib/BaseIncOptional.pm b/dist/base/t/lib/BaseIncOptional.pm
 new file mode 100644
-index 000000000..e5bf0174e
+index 0000000000..e5bf0174ef
 --- /dev/null
 +++ b/dist/base/t/lib/BaseIncOptional.pm
 @@ -0,0 +1,13 @@
diff --git a/debian/patches/debian/CVE-2016-1238/cpan-without-dot.diff b/debian/patches/debian/CVE-2016-1238/cpan-without-dot.diff
index d558de8c55..7bc1581912 100644
--- a/debian/patches/debian/CVE-2016-1238/cpan-without-dot.diff
+++ b/debian/patches/debian/CVE-2016-1238/cpan-without-dot.diff
@@ -13,7 +13,7 @@ Patch-Name: debian/CVE-2016-1238/cpan-without-dot.diff
  1 file changed, 5 insertions(+)
 
 diff --git a/cpan/CPAN/scripts/cpan b/cpan/CPAN/scripts/cpan
-index ccba47e22..e1c1f02d0 100644
+index ccba47e227..e1c1f02d0e 100644
 --- a/cpan/CPAN/scripts/cpan
 +++ b/cpan/CPAN/scripts/cpan
 @@ -4,6 +4,11 @@ BEGIN { pop @INC if $INC[-1] eq '.' }
diff --git a/debian/patches/debian/CVE-2016-1238/eumm-without-dot.diff b/debian/patches/debian/CVE-2016-1238/eumm-without-dot.diff
index c7655b15f0..13ebe931cd 100644
--- a/debian/patches/debian/CVE-2016-1238/eumm-without-dot.diff
+++ b/debian/patches/debian/CVE-2016-1238/eumm-without-dot.diff
@@ -18,7 +18,7 @@ Patch-Name: debian/CVE-2016-1238/eumm-without-dot.diff
  2 files changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
-index 80f95ab99..cf4d3e9e3 100644
+index 80f95ab997..cf4d3e9e33 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 @@ -3535,7 +3535,7 @@ PERL_DL_NONLAZY set for tests.
@@ -40,7 +40,7 @@ index 80f95ab99..cf4d3e9e3 100644
  
  
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
-index 5a9fce22b..199bf15c9 100644
+index 5a9fce22b1..199bf15c94 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
 @@ -5,6 +5,11 @@ use strict;
diff --git a/debian/patches/debian/CVE-2016-1238/remove-inc-test.diff b/debian/patches/debian/CVE-2016-1238/remove-inc-test.diff
index 239393c942..7a05961676 100644
--- a/debian/patches/debian/CVE-2016-1238/remove-inc-test.diff
+++ b/debian/patches/debian/CVE-2016-1238/remove-inc-test.diff
@@ -13,7 +13,7 @@ Patch-Name: debian/CVE-2016-1238/remove-inc-test.diff
  1 file changed, 1 insertion(+), 3 deletions(-)
 
 diff --git a/t/run/runenv.t b/t/run/runenv.t
-index 82846a4d2..53a6bf643 100644
+index 82846a4d28..53a6bf643e 100644
 --- a/t/run/runenv.t
 +++ b/t/run/runenv.t
 @@ -12,7 +12,7 @@ BEGIN {
diff --git a/debian/patches/debian/CVE-2016-1238/sitecustomize-in-etc.diff b/debian/patches/debian/CVE-2016-1238/sitecustomize-in-etc.diff
index 4fc72b5891..5c0bdfc066 100644
--- a/debian/patches/debian/CVE-2016-1238/sitecustomize-in-etc.diff
+++ b/debian/patches/debian/CVE-2016-1238/sitecustomize-in-etc.diff
@@ -17,7 +17,7 @@ Patch-Name: debian/CVE-2016-1238/sitecustomize-in-etc.diff
  2 files changed, 10 insertions(+)
 
 diff --git a/perl.c b/perl.c
-index 1e543e716..8ba560afe 100644
+index 1e543e7163..8ba560afe6 100644
 --- a/perl.c
 +++ b/perl.c
 @@ -2144,7 +2144,12 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit)
@@ -34,7 +34,7 @@ index 1e543e716..8ba560afe 100644
  	    /* process .../.. if PERL_RELOCATABLE_INC is defined */
  	    SV *sitelib_sv = mayberelocate(raw_sitelib, strlen(raw_sitelib),
 diff --git a/pod/perlrun.pod b/pod/perlrun.pod
-index 349e91e3d..db50b233f 100644
+index 349e91e3d6..db50b233fc 100644
 --- a/pod/perlrun.pod
 +++ b/pod/perlrun.pod
 @@ -494,6 +494,11 @@ blocks will be likewise executed very late.
diff --git a/debian/patches/debian/CVE-2016-1238/test-suite-without-dot.diff b/debian/patches/debian/CVE-2016-1238/test-suite-without-dot.diff
index f476748643..25a48ba282 100644
--- a/debian/patches/debian/CVE-2016-1238/test-suite-without-dot.diff
+++ b/debian/patches/debian/CVE-2016-1238/test-suite-without-dot.diff
@@ -29,7 +29,7 @@ Patch-Name: debian/CVE-2016-1238/test-suite-without-dot.diff
  17 files changed, 24 insertions(+), 17 deletions(-)
 
 diff --git a/Makefile.SH b/Makefile.SH
-index 5f195299b..f56827f22 100755
+index 5f195299bf..f56827f220 100755
 --- a/Makefile.SH
 +++ b/Makefile.SH
 @@ -342,7 +342,7 @@ RUN_PERL = \$(LDLIBPTH) \$(RUN) $perl\$(EXE_EXT)
@@ -42,7 +42,7 @@ index 5f195299b..f56827f22 100755
  	;;
  esac
 diff --git a/Porting/pod_rules.pl b/Porting/pod_rules.pl
-index 0d837bf23..f4c094db3 100644
+index 0d837bf232..f4c094db3c 100644
 --- a/Porting/pod_rules.pl
 +++ b/Porting/pod_rules.pl
 @@ -32,7 +32,7 @@ if (ord("A") == 193) {
@@ -55,7 +55,7 @@ index 0d837bf23..f4c094db3 100644
  
  # process command-line switches
 diff --git a/TestInit.pm b/TestInit.pm
-index f4ed6fd93..f9a5e916c 100644
+index f4ed6fd93d..f9a5e916cc 100644
 --- a/TestInit.pm
 +++ b/TestInit.pm
 @@ -47,7 +47,7 @@ sub import {
@@ -68,7 +68,7 @@ index f4ed6fd93..f9a5e916c 100644
  	} else {
  	    die "Unknown option '$_'";
 diff --git a/lib/strict.t b/lib/strict.t
-index d6c6ed0e4..bfee7620c 100644
+index d6c6ed0e41..bfee7620c2 100644
 --- a/lib/strict.t
 +++ b/lib/strict.t
 @@ -1,7 +1,7 @@
@@ -81,7 +81,7 @@ index d6c6ed0e4..bfee7620c 100644
  our $local_tests = 6;
  require "../t/lib/common.pl";
 diff --git a/lib/warnings.t b/lib/warnings.t
-index ee696fe2a..7c24f3af2 100644
+index ee696fe2a1..7c24f3af2a 100644
 --- a/lib/warnings.t
 +++ b/lib/warnings.t
 @@ -1,7 +1,7 @@
@@ -94,7 +94,7 @@ index ee696fe2a..7c24f3af2 100644
  our $UTF8 = (${^OPEN} || "") =~ /:utf8/;
  require "../t/lib/common.pl";
 diff --git a/makedef.pl b/makedef.pl
-index 104696c8f..c0a220a6f 100644
+index 104696c8f3..c0a220a6f2 100644
 --- a/makedef.pl
 +++ b/makedef.pl
 @@ -70,7 +70,7 @@ BEGIN {
@@ -107,7 +107,7 @@ index 104696c8f..c0a220a6f 100644
  # Is the following guard strictly necessary? Added during refactoring
  # to keep the same behaviour when merging other code into here.
 diff --git a/regen.pl b/regen.pl
-index 878866835..71a6eda60 100644
+index 878866835e..71a6eda60a 100644
 --- a/regen.pl
 +++ b/regen.pl
 @@ -15,7 +15,7 @@ use strict;
@@ -120,7 +120,7 @@ index 878866835..71a6eda60 100644
    system @command
      and die "@command failed: $?" 
 diff --git a/regen/ebcdic.pl b/regen/ebcdic.pl
-index fa8a051df..718a7c868 100644
+index fa8a051dfc..718a7c8681 100644
 --- a/regen/ebcdic.pl
 +++ b/regen/ebcdic.pl
 @@ -1,6 +1,9 @@
@@ -134,7 +134,7 @@ index fa8a051df..718a7c868 100644
  require 'regen/charset_translations.pl';
  
 diff --git a/regen/genpacksizetables.pl b/regen/genpacksizetables.pl
-index 7a03dcd15..d88682231 100644
+index 7a03dcd150..d886822319 100644
 --- a/regen/genpacksizetables.pl
 +++ b/regen/genpacksizetables.pl
 @@ -3,7 +3,7 @@
@@ -147,7 +147,7 @@ index 7a03dcd15..d88682231 100644
  sub make_text {
      my ($chrmap, $letter, $unpredictable, $nocsum, $size, $condition) = @_;
 diff --git a/regen/mg_vtable.pl b/regen/mg_vtable.pl
-index a05a7d414..342f5e04c 100644
+index a05a7d4146..342f5e04c4 100644
 --- a/regen/mg_vtable.pl
 +++ b/regen/mg_vtable.pl
 @@ -20,7 +20,7 @@ require 5.004;
@@ -160,7 +160,7 @@ index a05a7d414..342f5e04c 100644
  
  my %mg =
 diff --git a/t/comp/line_debug.t b/t/comp/line_debug.t
-index 8361194bb..71626bbf3 100644
+index 8361194bbf..71626bbf35 100644
 --- a/t/comp/line_debug.t
 +++ b/t/comp/line_debug.t
 @@ -1,5 +1,7 @@
@@ -172,7 +172,7 @@ index 8361194bb..71626bbf3 100644
  
  sub ok {
 diff --git a/t/lib/warnings/op b/t/lib/warnings/op
-index 528639e5a..df9dadb48 100644
+index 528639e5a9..df9dadb48e 100644
 --- a/t/lib/warnings/op
 +++ b/t/lib/warnings/op
 @@ -1435,6 +1435,7 @@ END { print "in end\n"; }
@@ -184,7 +184,7 @@ index 528639e5a..df9dadb48 100644
  do "abc.pm";
  EXPECT
 diff --git a/t/op/goto.t b/t/op/goto.t
-index aa2f24fa7..a65ede2a2 100644
+index aa2f24fa7c..a65ede2a28 100644
 --- a/t/op/goto.t
 +++ b/t/op/goto.t
 @@ -280,7 +280,7 @@ YYY: print "OK\n";
@@ -197,7 +197,7 @@ index aa2f24fa7..a65ede2a2 100644
  unlink_all "Op_goto01.pm";
  
 diff --git a/t/porting/regen.t b/t/porting/regen.t
-index 5d085181c..d2342605f 100644
+index 5d085181ce..d2342605f6 100644
 --- a/t/porting/regen.t
 +++ b/t/porting/regen.t
 @@ -86,7 +86,7 @@ OUTER: foreach my $file (@files) {
@@ -210,7 +210,7 @@ index 5d085181c..d2342605f 100644
          and die "Failed to run $command: $?";
  }
 diff --git a/t/re/pat.t b/t/re/pat.t
-index 295a9f713..8652bf65e 100644
+index 295a9f7138..8652bf65e0 100644
 --- a/t/re/pat.t
 +++ b/t/re/pat.t
 @@ -1663,7 +1663,7 @@ EOP
@@ -232,7 +232,7 @@ index 295a9f713..8652bf65e 100644
                  # \x80 and \x41 are continuation bytes in their respective
                  # character sets
 diff --git a/t/run/switches.t b/t/run/switches.t
-index aa9bda385..2272c94a4 100644
+index aa9bda3859..2272c94a47 100644
 --- a/t/run/switches.t
 +++ b/t/run/switches.t
 @@ -194,17 +194,17 @@ sub import { print map "<\$_>", \@_ }
@@ -257,7 +257,7 @@ index aa9bda385..2272c94a4 100644
      );
  
 diff --git a/t/test.pl b/t/test.pl
-index acff745e9..4195c9a81 100644
+index acff745e93..4195c9a81c 100644
 --- a/t/test.pl
 +++ b/t/test.pl
 @@ -646,7 +646,7 @@ sub _create_runperl { # Create the string to qx in runperl().
diff --git a/debian/patches/debian/cpan-missing-site-dirs.diff b/debian/patches/debian/cpan-missing-site-dirs.diff
index 6ba2430f15..1d1400439f 100644
--- a/debian/patches/debian/cpan-missing-site-dirs.diff
+++ b/debian/patches/debian/cpan-missing-site-dirs.diff
@@ -18,7 +18,7 @@ Patch-Name: debian/cpan-missing-site-dirs.diff
  1 file changed, 27 insertions(+), 4 deletions(-)
 
 diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm
-index 33054cd28..7b0becfc3 100644
+index 33054cd284..7b0becfc3d 100644
 --- a/cpan/CPAN/lib/CPAN/FirstTime.pm
 +++ b/cpan/CPAN/lib/CPAN/FirstTime.pm
 @@ -2057,11 +2057,34 @@ sub _print_urllist {
diff --git a/debian/patches/debian/cpan_definstalldirs.diff b/debian/patches/debian/cpan_definstalldirs.diff
index af48217572..2e70193065 100644
--- a/debian/patches/debian/cpan_definstalldirs.diff
+++ b/debian/patches/debian/cpan_definstalldirs.diff
@@ -14,7 +14,7 @@ Patch-Name: debian/cpan_definstalldirs.diff
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/cpan/CPAN/lib/CPAN/FirstTime.pm b/cpan/CPAN/lib/CPAN/FirstTime.pm
-index 918e009a2..33054cd28 100644
+index 918e009a2b..33054cd284 100644
 --- a/cpan/CPAN/lib/CPAN/FirstTime.pm
 +++ b/cpan/CPAN/lib/CPAN/FirstTime.pm
 @@ -1024,7 +1024,7 @@ sub init {
diff --git a/debian/patches/debian/customized.diff b/debian/patches/debian/customized.diff
index 82ca50a8da..dd73042f45 100644
--- a/debian/patches/debian/customized.diff
+++ b/debian/patches/debian/customized.diff
@@ -9,7 +9,7 @@ Patch-Name: debian/customized.diff
  1 file changed, 16 insertions(+), 14 deletions(-)
 
 diff --git a/t/porting/customized.dat b/t/porting/customized.dat
-index defeae112..5d0a25529 100644
+index defeae1127..5d0a255298 100644
 --- a/t/porting/customized.dat
 +++ b/t/porting/customized.dat
 @@ -5,12 +5,12 @@ Archive::Tar cpan/Archive-Tar/lib/Archive/Tar.pm b7e13134a5bcabe8c33fb0729d2f2f8
diff --git a/debian/patches/debian/db_file_ver.diff b/debian/patches/debian/db_file_ver.diff
index 1abe154aaa..2b4ceca3b9 100644
--- a/debian/patches/debian/db_file_ver.diff
+++ b/debian/patches/debian/db_file_ver.diff
@@ -13,7 +13,7 @@ Patch-Name: debian/db_file_ver.diff
  1 file changed, 2 insertions(+)
 
 diff --git a/cpan/DB_File/version.c b/cpan/DB_File/version.c
-index e01f6f6fa..544e6ee8f 100644
+index e01f6f6fa3..544e6ee8fb 100644
 --- a/cpan/DB_File/version.c
 +++ b/cpan/DB_File/version.c
 @@ -48,6 +48,7 @@ __getBerkeleyDBInfo()
diff --git a/debian/patches/debian/deprecate-with-apt.diff b/debian/patches/debian/deprecate-with-apt.diff
index 77d52c14ed..c5eb5a5a32 100644
--- a/debian/patches/debian/deprecate-with-apt.diff
+++ b/debian/patches/debian/deprecate-with-apt.diff
@@ -20,7 +20,7 @@ Patch-Name: debian/deprecate-with-apt.diff
  1 file changed, 14 insertions(+), 1 deletion(-)
 
 diff --git a/lib/deprecate.pm b/lib/deprecate.pm
-index 47bc11253..b0c61dfb0 100644
+index 47bc11253e..b0c61dfb05 100644
 --- a/lib/deprecate.pm
 +++ b/lib/deprecate.pm
 @@ -7,6 +7,13 @@ our $VERSION = 0.03;
diff --git a/debian/patches/debian/devel-ppport-reproducibility.diff b/debian/patches/debian/devel-ppport-reproducibility.diff
index da4249267e..be73be4f1e 100644
--- a/debian/patches/debian/devel-ppport-reproducibility.diff
+++ b/debian/patches/debian/devel-ppport-reproducibility.diff
@@ -15,7 +15,7 @@ Patch-Name: debian/devel-ppport-reproducibility.diff
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/cpan/Devel-PPPort/PPPort_xs.PL b/cpan/Devel-PPPort/PPPort_xs.PL
-index 5f18940ef..149f2fe07 100644
+index 5f18940ef1..149f2fe07e 100644
 --- a/cpan/Devel-PPPort/PPPort_xs.PL
 +++ b/cpan/Devel-PPPort/PPPort_xs.PL
 @@ -38,7 +38,7 @@ END
diff --git a/debian/patches/debian/doc_info.diff b/debian/patches/debian/doc_info.diff
index c2d5cdeefd..7d07e4de47 100644
--- a/debian/patches/debian/doc_info.diff
+++ b/debian/patches/debian/doc_info.diff
@@ -11,7 +11,7 @@ Patch-Name: debian/doc_info.diff
  1 file changed, 10 insertions(+), 2 deletions(-)
 
 diff --git a/pod/perl.pod b/pod/perl.pod
-index 671044e7d..e8e1197d9 100644
+index 671044e7d1..e8e1197d96 100644
 --- a/pod/perl.pod
 +++ b/pod/perl.pod
 @@ -284,8 +284,16 @@ aux c2ph h2ph h2xs perlbug pl2pm pod2html pod2man splain xsubpp
diff --git a/debian/patches/debian/document_inc_removal.diff b/debian/patches/debian/document_inc_removal.diff
index ffda352b9e..2278084b62 100644
--- a/debian/patches/debian/document_inc_removal.diff
+++ b/debian/patches/debian/document_inc_removal.diff
@@ -9,7 +9,7 @@ Patch-Name: debian/document_inc_removal.diff
  1 file changed, 5 insertions(+), 3 deletions(-)
 
 diff --git a/pod/perlvar.pod b/pod/perlvar.pod
-index 1821b95d1..c3e8e4f89 100644
+index 1821b95d1c..c3e8e4f893 100644
 --- a/pod/perlvar.pod
 +++ b/pod/perlvar.pod
 @@ -503,9 +503,11 @@ initially consists of the arguments to any B<-I> command-line
diff --git a/debian/patches/debian/enc2xs_inc.diff b/debian/patches/debian/enc2xs_inc.diff
index f9b53a5569..d8fcf3ab68 100644
--- a/debian/patches/debian/enc2xs_inc.diff
+++ b/debian/patches/debian/enc2xs_inc.diff
@@ -17,7 +17,7 @@ Patch-Name: debian/enc2xs_inc.diff
  2 files changed, 7 insertions(+), 4 deletions(-)
 
 diff --git a/cpan/Encode/bin/enc2xs b/cpan/Encode/bin/enc2xs
-index f8d9f52f2..5f6bb43fe 100644
+index f8d9f52f2a..5f6bb43fea 100644
 --- a/cpan/Encode/bin/enc2xs
 +++ b/cpan/Encode/bin/enc2xs
 @@ -985,11 +985,11 @@ use vars qw(
@@ -53,7 +53,7 @@ index f8d9f52f2..5f6bb43fe 100644
      for my $enc ( sort keys %LocalMod ) {
          $_ModLines .=
 diff --git a/t/porting/customized.t b/t/porting/customized.t
-index 45fcafb10..3bd6adb33 100644
+index 45fcafb100..3bd6adb33a 100644
 --- a/t/porting/customized.t
 +++ b/t/porting/customized.t
 @@ -101,8 +101,11 @@ foreach my $module ( sort keys %Modules ) {
diff --git a/debian/patches/debian/encode-unicode-bom-doc.diff b/debian/patches/debian/encode-unicode-bom-doc.diff
index 99993c1967..6676b8b6ed 100644
--- a/debian/patches/debian/encode-unicode-bom-doc.diff
+++ b/debian/patches/debian/encode-unicode-bom-doc.diff
@@ -10,7 +10,7 @@ Patch-Name: debian/encode-unicode-bom-doc.diff
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/cpan/Encode/Unicode/Unicode.pm b/cpan/Encode/Unicode/Unicode.pm
-index 7dec3e381..708a03440 100644
+index 7dec3e3815..708a03440d 100644
 --- a/cpan/Encode/Unicode/Unicode.pm
 +++ b/cpan/Encode/Unicode/Unicode.pm
 @@ -184,7 +184,9 @@ Default Byte Order
diff --git a/debian/patches/debian/errno_ver.diff b/debian/patches/debian/errno_ver.diff
index bad1a5b6ff..a78934a81d 100644
--- a/debian/patches/debian/errno_ver.diff
+++ b/debian/patches/debian/errno_ver.diff
@@ -16,7 +16,7 @@ Patch-Name: debian/errno_ver.diff
  1 file changed, 16 deletions(-)
 
 diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
-index 6251a3cf3..472dfba08 100644
+index 6251a3cf33..472dfba08d 100644
 --- a/ext/Errno/Errno_pm.PL
 +++ b/ext/Errno/Errno_pm.PL
 @@ -287,22 +287,6 @@ package Errno;
diff --git a/debian/patches/debian/extutils_set_libperl_path.diff b/debian/patches/debian/extutils_set_libperl_path.diff
index a34b368729..a8a990200a 100644
--- a/debian/patches/debian/extutils_set_libperl_path.diff
+++ b/debian/patches/debian/extutils_set_libperl_path.diff
@@ -12,7 +12,7 @@ Patch-Name: debian/extutils_set_libperl_path.diff
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
-index 9af9458d7..01e42d2d6 100644
+index 9af9458d75..01e42d2d67 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 @@ -2506,7 +2506,7 @@ MAP_PRELIBS   = $Config{perllibs} $Config{cryptlib}
diff --git a/debian/patches/debian/fakeroot.diff b/debian/patches/debian/fakeroot.diff
index 33e36ca06f..cf053bf462 100644
--- a/debian/patches/debian/fakeroot.diff
+++ b/debian/patches/debian/fakeroot.diff
@@ -16,7 +16,7 @@ Patch-Name: debian/fakeroot.diff
  1 file changed, 2 insertions(+), 5 deletions(-)
 
 diff --git a/Makefile.SH b/Makefile.SH
-index 8e943c4d8..5f195299b 100755
+index 8e943c4d8e..5f195299bf 100755
 --- a/Makefile.SH
 +++ b/Makefile.SH
 @@ -48,10 +48,7 @@ case "$useshrplib" in
diff --git a/debian/patches/debian/find_html2text.diff b/debian/patches/debian/find_html2text.diff
index 7a5c050af4..1951deb598 100644
--- a/debian/patches/debian/find_html2text.diff
+++ b/debian/patches/debian/find_html2text.diff
@@ -21,7 +21,7 @@ functionality].
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/cpan/CPAN/lib/CPAN/Distribution.pm b/cpan/CPAN/lib/CPAN/Distribution.pm
-index 092b781ac..5c2bae1c8 100644
+index 092b781ac2..5c2bae1c8f 100644
 --- a/cpan/CPAN/lib/CPAN/Distribution.pm
 +++ b/cpan/CPAN/lib/CPAN/Distribution.pm
 @@ -4099,7 +4099,7 @@ sub _display_url {
diff --git a/debian/patches/debian/hppa_op_optimize_workaround.diff b/debian/patches/debian/hppa_op_optimize_workaround.diff
index 23c5dc554e..3fe7b2fd81 100644
--- a/debian/patches/debian/hppa_op_optimize_workaround.diff
+++ b/debian/patches/debian/hppa_op_optimize_workaround.diff
@@ -16,7 +16,7 @@ Patch-Name: debian/hppa_op_optimize_workaround.diff
  1 file changed, 6 insertions(+)
 
 diff --git a/cflags.SH b/cflags.SH
-index a50044eb9..ba4ac8932 100755
+index a50044eb9a..ba4ac8932b 100755
 --- a/cflags.SH
 +++ b/cflags.SH
 @@ -495,6 +495,12 @@ for file do
diff --git a/debian/patches/debian/hurd-softupdates.diff b/debian/patches/debian/hurd-softupdates.diff
index 1a6790b02e..cc21720ef4 100644
--- a/debian/patches/debian/hurd-softupdates.diff
+++ b/debian/patches/debian/hurd-softupdates.diff
@@ -13,7 +13,7 @@ Patch-Name: debian/hurd-softupdates.diff
  1 file changed, 1 insertion(+)
 
 diff --git a/t/op/stat.t b/t/op/stat.t
-index 0a7f971af..1dc3ff2c0 100644
+index 0a7f971af5..1dc3ff2c0b 100644
 --- a/t/op/stat.t
 +++ b/t/op/stat.t
 @@ -97,6 +97,7 @@ print FOO "Now is the time for all good men to come to.\n";
diff --git a/debian/patches/debian/installman-utf8.diff b/debian/patches/debian/installman-utf8.diff
index 1b82d8b6d4..39ecc05043 100644
--- a/debian/patches/debian/installman-utf8.diff
+++ b/debian/patches/debian/installman-utf8.diff
@@ -15,7 +15,7 @@ Patch-Name: debian/installman-utf8.diff
  1 file changed, 1 insertion(+)
 
 diff --git a/installman b/installman
-index 60fbce3bd..fa7ac928a 100755
+index 60fbce3bde..fa7ac928aa 100755
 --- a/installman
 +++ b/installman
 @@ -153,6 +153,7 @@ sub pod2man {
diff --git a/debian/patches/debian/instmodsh_doc.diff b/debian/patches/debian/instmodsh_doc.diff
index cd261d66f1..38ce03b16c 100644
--- a/debian/patches/debian/instmodsh_doc.diff
+++ b/debian/patches/debian/instmodsh_doc.diff
@@ -9,7 +9,7 @@ Patch-Name: debian/instmodsh_doc.diff
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/cpan/ExtUtils-MakeMaker/bin/instmodsh b/cpan/ExtUtils-MakeMaker/bin/instmodsh
-index ab0f9d1ff..b3b109f47 100644
+index ab0f9d1ffe..b3b109f475 100644
 --- a/cpan/ExtUtils-MakeMaker/bin/instmodsh
 +++ b/cpan/ExtUtils-MakeMaker/bin/instmodsh
 @@ -19,9 +19,11 @@ instmodsh - A shell to examine installed modules
diff --git a/debian/patches/debian/kfreebsd-softupdates.diff b/debian/patches/debian/kfreebsd-softupdates.diff
index 275445b296..37521f133e 100644
--- a/debian/patches/debian/kfreebsd-softupdates.diff
+++ b/debian/patches/debian/kfreebsd-softupdates.diff
@@ -16,7 +16,7 @@ Patch-Name: debian/kfreebsd-softupdates.diff
  1 file changed, 1 insertion(+)
 
 diff --git a/t/op/stat.t b/t/op/stat.t
-index 637a9025f..0a7f971af 100644
+index 637a9025f1..0a7f971af5 100644
 --- a/t/op/stat.t
 +++ b/t/op/stat.t
 @@ -96,6 +96,7 @@ sleep 3 if $funky_FAT_timestamps;
diff --git a/debian/patches/debian/ld_run_path.diff b/debian/patches/debian/ld_run_path.diff
index f56972f38f..7a2db41a10 100644
--- a/debian/patches/debian/ld_run_path.diff
+++ b/debian/patches/debian/ld_run_path.diff
@@ -9,7 +9,7 @@ Patch-Name: debian/ld_run_path.diff
  1 file changed, 3 insertions(+)
 
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
-index 93183a379..63eecc127 100644
+index 93183a3792..63eecc127c 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Liblist/Kid.pm
 @@ -56,6 +56,9 @@ sub _unix_os2_ext {
diff --git a/debian/patches/debian/libnet_config_path.diff b/debian/patches/debian/libnet_config_path.diff
index 607218f09c..2d5bf98120 100644
--- a/debian/patches/debian/libnet_config_path.diff
+++ b/debian/patches/debian/libnet_config_path.diff
@@ -10,7 +10,7 @@ Patch-Name: debian/libnet_config_path.diff
  1 file changed, 3 insertions(+), 4 deletions(-)
 
 diff --git a/cpan/libnet/lib/Net/Config.pm b/cpan/libnet/lib/Net/Config.pm
-index 3e4ab0a03..295a33397 100644
+index 3e4ab0a03b..295a33397d 100644
 --- a/cpan/libnet/lib/Net/Config.pm
 +++ b/cpan/libnet/lib/Net/Config.pm
 @@ -74,9 +74,8 @@ my %nc = (
diff --git a/debian/patches/debian/libperl_embed_doc.diff b/debian/patches/debian/libperl_embed_doc.diff
index c2761480f4..5dcb329f66 100644
--- a/debian/patches/debian/libperl_embed_doc.diff
+++ b/debian/patches/debian/libperl_embed_doc.diff
@@ -11,7 +11,7 @@ Patch-Name: debian/libperl_embed_doc.diff
  1 file changed, 3 insertions(+)
 
 diff --git a/lib/ExtUtils/Embed.pm b/lib/ExtUtils/Embed.pm
-index 9305b5dc1..c5e42e123 100644
+index 9305b5dc13..c5e42e123c 100644
 --- a/lib/ExtUtils/Embed.pm
 +++ b/lib/ExtUtils/Embed.pm
 @@ -296,6 +296,9 @@ and extensions in your C/C++ applications.
diff --git a/debian/patches/debian/makemaker-manext.diff b/debian/patches/debian/makemaker-manext.diff
index 3420b2d0be..1a12fa1577 100644
--- a/debian/patches/debian/makemaker-manext.diff
+++ b/debian/patches/debian/makemaker-manext.diff
@@ -15,7 +15,7 @@ Bug-Debian: https://bugs.debian.org/247370
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
-index 7679dc415..b13c74857 100644
+index 7679dc415a..b13c74857c 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Any.pm
 @@ -928,7 +928,7 @@ END
diff --git a/debian/patches/debian/makemaker-pasthru.diff b/debian/patches/debian/makemaker-pasthru.diff
index 67a775218a..3062186275 100644
--- a/debian/patches/debian/makemaker-pasthru.diff
+++ b/debian/patches/debian/makemaker-pasthru.diff
@@ -16,7 +16,7 @@ Patch-Name: debian/makemaker-pasthru.diff
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
-index ff7bf2a2f..80f95ab99 100644
+index ff7bf2a2fa..80f95ab997 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 @@ -2794,7 +2794,7 @@ sub pasthru {
diff --git a/debian/patches/debian/mod_paths.diff b/debian/patches/debian/mod_paths.diff
index 80aa0a8731..6c8d5d5884 100644
--- a/debian/patches/debian/mod_paths.diff
+++ b/debian/patches/debian/mod_paths.diff
@@ -22,7 +22,7 @@ Patch-Name: debian/mod_paths.diff
  1 file changed, 58 insertions(+)
 
 diff --git a/perl.c b/perl.c
-index 6197ea08d..1e543e716 100644
+index 6197ea08d5..1e543e7163 100644
 --- a/perl.c
 +++ b/perl.c
 @@ -4483,6 +4483,11 @@ S_init_perllib(pTHX)
diff --git a/debian/patches/debian/no_packlist_perllocal.diff b/debian/patches/debian/no_packlist_perllocal.diff
index a7e8e1cfde..deaf0c77e6 100644
--- a/debian/patches/debian/no_packlist_perllocal.diff
+++ b/debian/patches/debian/no_packlist_perllocal.diff
@@ -5,25 +5,25 @@ Subject: Don't install .packlist or perllocal.pod for perl or vendor
 
 Patch-Name: debian/no_packlist_perllocal.diff
 ---
- cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 35 +++----------------------
+ .../lib/ExtUtils/MM_Unix.pm                   | 35 ++-----------------
  1 file changed, 3 insertions(+), 32 deletions(-)
 
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
-index 01e42d2d6..ff7bf2a2f 100644
+index 01e42d2d67..ff7bf2a2fa 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
-@@ -2123,11 +2123,6 @@ pure_perl_install :: all
+@@ -2122,11 +2122,6 @@ pure_perl_install :: all
+ 	$(NOECHO) umask 022; $(MOD_INSTALL) \
  };
  
-     push @m,
+-    push @m,
 -q{		read "}.$self->catfile('$(PERL_ARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
 -		write "}.$self->catfile('$(DESTINSTALLARCHLIB)','auto','$(FULLEXT)','.packlist').q{" \
 -} unless $self->{NO_PACKLIST};
 -
--    push @m,
+     push @m,
  q{		"$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
  		"$(INST_ARCHLIB)" "$(DESTINSTALLARCHLIB)" \
- 		"$(INST_BIN)" "$(DESTINSTALLBIN)" \
 @@ -2159,10 +2154,6 @@ q{		"$(INST_LIB)" "$(DESTINSTALLSITELIB)" \
  pure_vendor_install :: all
  	$(NOECHO) umask 022; $(MOD_INSTALL) \
diff --git a/debian/patches/debian/patchlevel.diff b/debian/patches/debian/patchlevel.diff
index 61f865cbc9..4888a13117 100644
--- a/debian/patches/debian/patchlevel.diff
+++ b/debian/patches/debian/patchlevel.diff
@@ -15,7 +15,7 @@ Patch-Name: debian/patchlevel.diff
  1 file changed, 3 insertions(+)
 
 diff --git a/patchlevel.h b/patchlevel.h
-index 0d8ab183f..8a5c0c995 100644
+index 0d8ab183f3..8a5c0c9953 100644
 --- a/patchlevel.h
 +++ b/patchlevel.h
 @@ -137,6 +137,9 @@ static const char * const local_patches[] = {
diff --git a/debian/patches/debian/perl5db-x-terminal-emulator.patch b/debian/patches/debian/perl5db-x-terminal-emulator.patch
index 043b5a0440..fb9f510d65 100644
--- a/debian/patches/debian/perl5db-x-terminal-emulator.patch
+++ b/debian/patches/debian/perl5db-x-terminal-emulator.patch
@@ -15,7 +15,7 @@ Patch-Name: debian/perl5db-x-terminal-emulator.patch
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/lib/perl5db.pl b/lib/perl5db.pl
-index 6dae6b0f5..5e79381a8 100644
+index 6dae6b0f5c..5e79381a8a 100644
 --- a/lib/perl5db.pl
 +++ b/lib/perl5db.pl
 @@ -6984,7 +6984,7 @@ properly set up.
diff --git a/debian/patches/debian/perlivp.diff b/debian/patches/debian/perlivp.diff
index b28d076fe2..24c80a0f0b 100644
--- a/debian/patches/debian/perlivp.diff
+++ b/debian/patches/debian/perlivp.diff
@@ -26,7 +26,7 @@ Patch-Name: debian/perlivp.diff
  1 file changed, 1 insertion(+)
 
 diff --git a/utils/perlivp.PL b/utils/perlivp.PL
-index e5229133f..696a44e0f 100644
+index e5229133f4..696a44e0fe 100644
 --- a/utils/perlivp.PL
 +++ b/utils/perlivp.PL
 @@ -155,6 +155,7 @@ my $INC_total = 0;
diff --git a/debian/patches/debian/prune_libs.diff b/debian/patches/debian/prune_libs.diff
index 7f88ea4f89..fee12887cb 100644
--- a/debian/patches/debian/prune_libs.diff
+++ b/debian/patches/debian/prune_libs.diff
@@ -14,7 +14,7 @@ Patch-Name: debian/prune_libs.diff
  1 file changed, 2 insertions(+), 3 deletions(-)
 
 diff --git a/Configure b/Configure
-index 5a353d6de..a00df640e 100755
+index 5a353d6de4..a00df640e4 100755
 --- a/Configure
 +++ b/Configure
 @@ -1479,8 +1479,7 @@ archname=''
diff --git a/debian/patches/debian/regen-skip.diff b/debian/patches/debian/regen-skip.diff
index dd46d6995f..4af5353d0a 100644
--- a/debian/patches/debian/regen-skip.diff
+++ b/debian/patches/debian/regen-skip.diff
@@ -13,7 +13,7 @@ Patch-Name: debian/regen-skip.diff
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/regen/lib_cleanup.pl b/regen/lib_cleanup.pl
-index c9d6e434b..fece1ed5e 100644
+index c9d6e434bd..fece1ed5e0 100644
 --- a/regen/lib_cleanup.pl
 +++ b/regen/lib_cleanup.pl
 @@ -159,7 +159,7 @@ foreach ('win32/Makefile', 'win32/makefile.mk') {
diff --git a/debian/patches/debian/skip-kfreebsd-crash.diff b/debian/patches/debian/skip-kfreebsd-crash.diff
index 8f74978075..ab29f16dd9 100644
--- a/debian/patches/debian/skip-kfreebsd-crash.diff
+++ b/debian/patches/debian/skip-kfreebsd-crash.diff
@@ -17,7 +17,7 @@ Patch-Name: debian/skip-kfreebsd-crash.diff
  1 file changed, 4 insertions(+)
 
 diff --git a/t/op/threads.t b/t/op/threads.t
-index 123ad27e3..e12bf584d 100644
+index 123ad27e3a..e12bf584d6 100644
 --- a/t/op/threads.t
 +++ b/t/op/threads.t
 @@ -376,6 +376,9 @@ EOF
diff --git a/debian/patches/debian/skip-upstream-git-tests.diff b/debian/patches/debian/skip-upstream-git-tests.diff
index a945117030..09bb5641ae 100644
--- a/debian/patches/debian/skip-upstream-git-tests.diff
+++ b/debian/patches/debian/skip-upstream-git-tests.diff
@@ -14,7 +14,7 @@ Patch-Name: debian/skip-upstream-git-tests.diff
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/t/test.pl b/t/test.pl
-index 84475ea3e..acff745e9 100644
+index 84475ea3ee..acff745e93 100644
 --- a/t/test.pl
 +++ b/t/test.pl
 @@ -174,7 +174,7 @@ sub skip_all_without_unicode_tables { # (but only under miniperl)
diff --git a/debian/patches/debian/squelch-locale-warnings.diff b/debian/patches/debian/squelch-locale-warnings.diff
index eb034593ce..f9f26ae22c 100644
--- a/debian/patches/debian/squelch-locale-warnings.diff
+++ b/debian/patches/debian/squelch-locale-warnings.diff
@@ -20,7 +20,7 @@ Patch-Name: debian/squelch-locale-warnings.diff
  2 files changed, 12 insertions(+), 1 deletion(-)
 
 diff --git a/locale.c b/locale.c
-index bf8713a66..d43ad160b 100644
+index bf8713a665..d43ad160be 100644
 --- a/locale.c
 +++ b/locale.c
 @@ -760,7 +760,10 @@ Perl_init_i18nl10n(pTHX_ int printwarn)
@@ -36,7 +36,7 @@ index bf8713a66..d43ad160b 100644
                                      /* disallow with "" or "0" */
                                      *bad_lang_use_once
 diff --git a/pod/perllocale.pod b/pod/perllocale.pod
-index 018f91623..59b4efc2d 100644
+index 018f916231..59b4efc2d3 100644
 --- a/pod/perllocale.pod
 +++ b/pod/perllocale.pod
 @@ -1209,6 +1209,14 @@ B<NOTE>: C<PERL_BADLANG> only gives you a way to hide the warning message.
diff --git a/debian/patches/debian/writable_site_dirs.diff b/debian/patches/debian/writable_site_dirs.diff
index 1cb6359859..d9fef6070c 100644
--- a/debian/patches/debian/writable_site_dirs.diff
+++ b/debian/patches/debian/writable_site_dirs.diff
@@ -11,7 +11,7 @@ Patch-Name: debian/writable_site_dirs.diff
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
-index 1f4542e9d..9af9458d7 100644
+index 1f4542e9da..9af9458d75 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 @@ -2139,7 +2139,7 @@ q{		"$(INST_LIB)" "$(DESTINSTALLPRIVLIB)" \
diff --git a/debian/patches/fixes/CVE-2017-12837.diff b/debian/patches/fixes/CVE-2017-12837.diff
index 6aee7729c7..71cee531b1 100644
--- a/debian/patches/fixes/CVE-2017-12837.diff
+++ b/debian/patches/fixes/CVE-2017-12837.diff
@@ -14,7 +14,7 @@ Patch-Name: fixes/CVE-2017-12837.diff
  1 file changed, 1 insertion(+)
 
 diff --git a/regcomp.c b/regcomp.c
-index be6cb96a7..77f4d3f46 100644
+index be6cb96a70..77f4d3f469 100644
 --- a/regcomp.c
 +++ b/regcomp.c
 @@ -13018,6 +13018,7 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
diff --git a/debian/patches/fixes/CVE-2017-12883.diff b/debian/patches/fixes/CVE-2017-12883.diff
index 81d99fadbe..c826bb6a0a 100644
--- a/debian/patches/fixes/CVE-2017-12883.diff
+++ b/debian/patches/fixes/CVE-2017-12883.diff
@@ -20,7 +20,7 @@ Patch-Name: fixes/CVE-2017-12883.diff
  1 file changed, 4 insertions(+), 2 deletions(-)
 
 diff --git a/regcomp.c b/regcomp.c
-index 77f4d3f46..29b1ffe7c 100644
+index 77f4d3f469..29b1ffe7c5 100644
 --- a/regcomp.c
 +++ b/regcomp.c
 @@ -11918,14 +11918,16 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state,
diff --git a/debian/patches/fixes/CVE-2018-12015-Archive-Tar-directory-traversal.diff b/debian/patches/fixes/CVE-2018-12015-Archive-Tar-directory-traversal.diff
index e508cefc4e..f34cb8d359 100644
--- a/debian/patches/fixes/CVE-2018-12015-Archive-Tar-directory-traversal.diff
+++ b/debian/patches/fixes/CVE-2018-12015-Archive-Tar-directory-traversal.diff
@@ -20,7 +20,7 @@ Patch-Name: fixes/CVE-2018-12015-Archive-Tar-directory-traversal.diff
  2 files changed, 15 insertions(+), 1 deletion(-)
 
 diff --git a/cpan/Archive-Tar/lib/Archive/Tar.pm b/cpan/Archive-Tar/lib/Archive/Tar.pm
-index 6a047a32d..d110bd7bd 100644
+index 6a047a32d6..d110bd7bd8 100644
 --- a/cpan/Archive-Tar/lib/Archive/Tar.pm
 +++ b/cpan/Archive-Tar/lib/Archive/Tar.pm
 @@ -845,6 +845,20 @@ sub _extract_file {
@@ -45,7 +45,7 @@ index 6a047a32d..d110bd7bd 100644
          my $fh = IO::File->new;
          $fh->open( '>' . $full ) or (
 diff --git a/t/porting/customized.dat b/t/porting/customized.dat
-index 5d0a25529..5aed9c2ce 100644
+index 5d0a255298..5aed9c2ce2 100644
 --- a/t/porting/customized.dat
 +++ b/t/porting/customized.dat
 @@ -1,7 +1,7 @@
diff --git a/debian/patches/fixes/CVE-2018-18311.diff b/debian/patches/fixes/CVE-2018-18311.diff
index 3bbaf97e40..577e1e5f09 100644
--- a/debian/patches/fixes/CVE-2018-18311.diff
+++ b/debian/patches/fixes/CVE-2018-18311.diff
@@ -24,11 +24,11 @@ whitespace changes only]
 Origin: upstream
 Patch-Name: fixes/CVE-2018-18311.diff
 ---
- util.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++--------------------
+ util.c | 76 ++++++++++++++++++++++++++++++++++++++++------------------
  1 file changed, 53 insertions(+), 23 deletions(-)
 
 diff --git a/util.c b/util.c
-index f1315045f..22068529d 100644
+index f1315045fa..22068529db 100644
 --- a/util.c
 +++ b/util.c
 @@ -2143,8 +2143,40 @@ Perl_new_warnings_bitfield(pTHX_ STRLEN *buffer, const char *const bits,
diff --git a/debian/patches/fixes/CVE-2018-18312.diff b/debian/patches/fixes/CVE-2018-18312.diff
index f09eca22a0..eb8cf6c2d0 100644
Binary files a/debian/patches/fixes/CVE-2018-18312.diff and b/debian/patches/fixes/CVE-2018-18312.diff differ
diff --git a/debian/patches/fixes/CVE-2018-18313.diff b/debian/patches/fixes/CVE-2018-18313.diff
index 1fca9d6031..5bc4ee6c5e 100644
--- a/debian/patches/fixes/CVE-2018-18313.diff
+++ b/debian/patches/fixes/CVE-2018-18313.diff
@@ -15,7 +15,7 @@ Patch-Name: fixes/CVE-2018-18313.diff
  1 file changed, 6 insertions(+), 4 deletions(-)
 
 diff --git a/regcomp.c b/regcomp.c
-index d283e3ca6..2a7700c5a 100644
+index d283e3ca65..2a7700c5a4 100644
 --- a/regcomp.c
 +++ b/regcomp.c
 @@ -11779,7 +11779,7 @@ S_grok_bslash_N(pTHX_ RExC_state_t *pRExC_state,
diff --git a/debian/patches/fixes/CVE-2018-18314.diff b/debian/patches/fixes/CVE-2018-18314.diff
index 8268c3f2ab..d3425ffd0a 100644
--- a/debian/patches/fixes/CVE-2018-18314.diff
+++ b/debian/patches/fixes/CVE-2018-18314.diff
@@ -25,7 +25,7 @@ Patch-Name: fixes/CVE-2018-18314.diff
  6 files changed, 68 insertions(+), 32 deletions(-)
 
 diff --git a/pod/perldiag.pod b/pod/perldiag.pod
-index 78aeb164e..11467a1a1 100644
+index 78aeb164e3..11467a1a12 100644
 --- a/pod/perldiag.pod
 +++ b/pod/perldiag.pod
 @@ -5775,7 +5775,7 @@ yourself.
@@ -70,7 +70,7 @@ index 78aeb164e..11467a1a1 100644
  marked by S<<-- HERE> in m/%s/
  
 diff --git a/pod/perlrecharclass.pod b/pod/perlrecharclass.pod
-index 7f5a4ef27..920c19af3 100644
+index 7f5a4ef273..920c19af33 100644
 --- a/pod/perlrecharclass.pod
 +++ b/pod/perlrecharclass.pod
 @@ -1101,8 +1101,8 @@ hence both of the following work:
@@ -85,7 +85,7 @@ index 7f5a4ef27..920c19af3 100644
  just three limitations:
  
 diff --git a/regcomp.c b/regcomp.c
-index 2a7700c5a..ab2c236ec 100644
+index 2a7700c5a4..ab2c236ec2 100644
 --- a/regcomp.c
 +++ b/regcomp.c
 @@ -14608,8 +14608,9 @@ S_handle_regex_sets(pTHX_ RExC_state_t *pRExC_state, SV** return_invlist,
@@ -160,7 +160,7 @@ index 2a7700c5a..ab2c236ec 100644
                      RExC_flags = save_flags;
                      goto handle_operand;
 diff --git a/t/lib/warnings/regcomp b/t/lib/warnings/regcomp
-index 08cb27b00..367276d0f 100644
+index 08cb27b00f..367276d0fc 100644
 --- a/t/lib/warnings/regcomp
 +++ b/t/lib/warnings/regcomp
 @@ -59,21 +59,21 @@ Unmatched [ in regex; marked by <-- HERE in m/abc[ <-- HERE fi[.00./ at - line
@@ -189,7 +189,7 @@ index 08cb27b00..367276d0f 100644
  # NAME [perl #126141]
  # OPTION fatal
 diff --git a/t/re/reg_mesg.t b/t/re/reg_mesg.t
-index 7c14281c6..8829e8121 100644
+index 7c14281c6b..8829e8121a 100644
 --- a/t/re/reg_mesg.t
 +++ b/t/re/reg_mesg.t
 @@ -202,8 +202,9 @@ my @death =
@@ -250,7 +250,7 @@ index 7c14281c6..8829e8121 100644
   '/\cネ/' => "Character following \"\\c\" must be printable ASCII",
   '/\b{ネ}/' => "'ネ' is an unknown bound type {#} m/\\b{ネ{#}}/",
 diff --git a/t/re/regex_sets.t b/t/re/regex_sets.t
-index cd5df00ed..7998cb4b4 100644
+index cd5df00ed0..7998cb4b46 100644
 --- a/t/re/regex_sets.t
 +++ b/t/re/regex_sets.t
 @@ -157,13 +157,13 @@ for my $char ("٠", "٥", "٩") {
diff --git a/debian/patches/fixes/CVE-2018-6797.diff b/debian/patches/fixes/CVE-2018-6797.diff
index 02c1277db4..0280ec6736 100644
--- a/debian/patches/fixes/CVE-2018-6797.diff
+++ b/debian/patches/fixes/CVE-2018-6797.diff
@@ -17,7 +17,7 @@ Patch-Name: fixes/CVE-2018-6797.diff
  2 files changed, 16 insertions(+)
 
 diff --git a/regcomp.c b/regcomp.c
-index 29b1ffe7c..1b84be0b4 100644
+index 29b1ffe7c5..1b84be0b45 100644
 --- a/regcomp.c
 +++ b/regcomp.c
 @@ -13319,6 +13319,18 @@ S_regatom(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth)
@@ -40,7 +40,7 @@ index 29b1ffe7c..1b84be0b4 100644
                              maybe_exactfu = FALSE;
                          }
 diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t
-index 913e84662..1c11e446e 100644
+index 913e84662f..1c11e446e1 100644
 --- a/t/re/pat_advanced.t
 +++ b/t/re/pat_advanced.t
 @@ -2369,6 +2369,10 @@ EOF
diff --git a/debian/patches/fixes/CVE-2018-6798/pt1.diff b/debian/patches/fixes/CVE-2018-6798/pt1.diff
index e11b029a21..3950ee4046 100644
--- a/debian/patches/fixes/CVE-2018-6798/pt1.diff
+++ b/debian/patches/fixes/CVE-2018-6798/pt1.diff
@@ -19,7 +19,7 @@ Patch-Name: fixes/CVE-2018-6798/pt1.diff
  2 files changed, 23 insertions(+), 13 deletions(-)
 
 diff --git a/regexec.c b/regexec.c
-index 4cea7d280..faacd85c1 100644
+index 4cea7d2801..faacd85c11 100644
 --- a/regexec.c
 +++ b/regexec.c
 @@ -1471,7 +1471,9 @@ Perl_re_intuit_start(pTHX_
@@ -108,7 +108,7 @@ index 4cea7d280..faacd85c1 100644
  			    foldlen -= len;
  			}
 diff --git a/t/lib/warnings/regexec b/t/lib/warnings/regexec
-index 900dd6ee7..6635142de 100644
+index 900dd6ee7f..6635142dea 100644
 --- a/t/lib/warnings/regexec
 +++ b/t/lib/warnings/regexec
 @@ -260,3 +260,10 @@ setlocale(&POSIX::LC_CTYPE, $utf8_locale);
diff --git a/debian/patches/fixes/CVE-2018-6798/pt2.diff b/debian/patches/fixes/CVE-2018-6798/pt2.diff
index adaecf5fb5..1a39489be0 100644
--- a/debian/patches/fixes/CVE-2018-6798/pt2.diff
+++ b/debian/patches/fixes/CVE-2018-6798/pt2.diff
@@ -16,7 +16,7 @@ Patch-Name: fixes/CVE-2018-6798/pt2.diff
  2 files changed, 11 insertions(+), 4 deletions(-)
 
 diff --git a/regexec.c b/regexec.c
-index faacd85c1..40a63a6fb 100644
+index faacd85c11..40a63a6fb4 100644
 --- a/regexec.c
 +++ b/regexec.c
 @@ -1456,7 +1456,7 @@ Perl_re_intuit_start(pTHX_
@@ -68,7 +68,7 @@ index faacd85c1..40a63a6fb 100644
              uvc = utf8n_to_uvchr( (const U8*) uscan, foldlen, &len, uniflags );     \
              foldlen -= len;                                                         \
 diff --git a/t/re/re_tests b/t/re/re_tests
-index 34ac94a21..caa068bbc 100644
+index 34ac94a213..caa068bbcc 100644
 --- a/t/re/re_tests
 +++ b/t/re/re_tests
 @@ -1966,6 +1966,7 @@ ab(?#Comment){2}c	abbc	y	$&	abbc
diff --git a/debian/patches/fixes/CVE-2018-6798/pt3.diff b/debian/patches/fixes/CVE-2018-6798/pt3.diff
index f7c3b1345f..ae94959d1e 100644
--- a/debian/patches/fixes/CVE-2018-6798/pt3.diff
+++ b/debian/patches/fixes/CVE-2018-6798/pt3.diff
@@ -17,7 +17,7 @@ Patch-Name: fixes/CVE-2018-6798/pt3.diff
  1 file changed, 3 deletions(-)
 
 diff --git a/t/lib/warnings/regexec b/t/lib/warnings/regexec
-index 6635142de..c370ddc3c 100644
+index 6635142dea..c370ddc3c7 100644
 --- a/t/lib/warnings/regexec
 +++ b/t/lib/warnings/regexec
 @@ -262,8 +262,5 @@ setlocale(&POSIX::LC_CTYPE, $utf8_locale);
diff --git a/debian/patches/fixes/CVE-2018-6913.diff b/debian/patches/fixes/CVE-2018-6913.diff
index 9c873ebf66..d5b241a15f 100644
--- a/debian/patches/fixes/CVE-2018-6913.diff
+++ b/debian/patches/fixes/CVE-2018-6913.diff
@@ -48,7 +48,7 @@ Patch-Name: fixes/CVE-2018-6913.diff
  2 files changed, 44 insertions(+), 5 deletions(-)
 
 diff --git a/pp_pack.c b/pp_pack.c
-index f6964c3f3..c0de5ab82 100644
+index f6964c3f30..c0de5ab82b 100644
 --- a/pp_pack.c
 +++ b/pp_pack.c
 @@ -358,11 +358,28 @@ STMT_START {							\
@@ -101,7 +101,7 @@ index f6964c3f3..c0de5ab82 100644
          }
  
 diff --git a/t/op/pack.t b/t/op/pack.t
-index a2da63689..a480c3ad7 100644
+index a2da63689b..a480c3ad7f 100644
 --- a/t/op/pack.t
 +++ b/t/op/pack.t
 @@ -12,7 +12,7 @@ my $no_endianness = $] > 5.009 ? '' :
diff --git a/debian/patches/fixes/CVE-2020-10543.diff b/debian/patches/fixes/CVE-2020-10543.diff
new file mode 100644
index 0000000000..a6c7005482
--- /dev/null
+++ b/debian/patches/fixes/CVE-2020-10543.diff
@@ -0,0 +1,32 @@
+From ab4568c2c2d8105475542bad77501a7edecdb4bc Mon Sep 17 00:00:00 2001
+From: John Lightsey <jd@cpanel.net>
+Date: Wed, 20 Nov 2019 20:02:45 -0600
+Subject: regcomp.c: Prevent integer overflow from nested regex quantifiers.
+
+(CVE-2020-10543) On 32bit systems the size calculations for nested regular
+expression quantifiers could overflow causing heap memory corruption.
+
+Bug-Debian: https://bugs.debian.org/962005
+Origin: upstream
+Patch-Name: fixes/CVE-2020-10543.diff
+---
+ regcomp.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/regcomp.c b/regcomp.c
+index ab2c236ec2..912e52e3e5 100644
+--- a/regcomp.c
++++ b/regcomp.c
+@@ -5065,6 +5065,12 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+ 		    (void)ReREFCNT_inc(RExC_rx_sv);
+ 		}
+ 
++                if ( ( minnext > 0 && mincount >= SSize_t_MAX / minnext )
++                    || min >= SSize_t_MAX - minnext * mincount )
++                {
++                    FAIL("Regexp out of space");
++                }
++
+ 		min += minnext * mincount;
+ 		is_inf_internal |= deltanext == SSize_t_MAX
+                          || (maxcount == REG_INFTY && minnext + deltanext > 0);
diff --git a/debian/patches/fixes/CVE-2020-10878.diff b/debian/patches/fixes/CVE-2020-10878.diff
new file mode 100644
index 0000000000..59c2ddf097
--- /dev/null
+++ b/debian/patches/fixes/CVE-2020-10878.diff
@@ -0,0 +1,152 @@
+From dd76cadb99fb0216980e6571564713f8fbf88572 Mon Sep 17 00:00:00 2001
+From: Hugo van der Sanden <hv@crypt.org>
+Date: Tue, 18 Feb 2020 13:51:16 +0000
+Subject: study_chunk: extract rck_elide_nothing
+
+(CVE-2020-10878)
+
+[Backported to 5.24 by Dominic Hargreaves for Debian]
+
+Bug-Debian: https://bugs.debian.org/962005
+Origin: upstream
+Patch-Name: fixes/CVE-2020-10878.diff
+---
+ embed.fnc |  1 +
+ embed.h   |  1 +
+ proto.h   |  3 +++
+ regcomp.c | 70 ++++++++++++++++++++++++++++++++++---------------------
+ 4 files changed, 48 insertions(+), 27 deletions(-)
+
+diff --git a/embed.fnc b/embed.fnc
+index a64ffbac74..c4c08cb507 100644
+--- a/embed.fnc
++++ b/embed.fnc
+@@ -2243,6 +2243,7 @@ Es	|SSize_t|study_chunk	|NN RExC_state_t *pRExC_state \
+                                 |I32 stopparen|U32 recursed_depth \
+ 				|NULLOK regnode_ssc *and_withp \
+ 				|U32 flags|U32 depth
++Es	|void	|rck_elide_nothing|NN regnode *node
+ EsRn	|U32	|add_data	|NN RExC_state_t* const pRExC_state \
+ 				|NN const char* const s|const U32 n
+ rs	|void	|re_croak2	|bool utf8|NN const char* pat1|NN const char* pat2|...
+diff --git a/embed.h b/embed.h
+index 42c65b2eb0..9af1fc064e 100644
+--- a/embed.h
++++ b/embed.h
+@@ -1026,6 +1026,7 @@
+ #define output_or_return_posix_warnings(a,b,c)	S_output_or_return_posix_warnings(aTHX_ a,b,c)
+ #define parse_lparen_question_flags(a)	S_parse_lparen_question_flags(aTHX_ a)
+ #define populate_ANYOF_from_invlist(a,b)	S_populate_ANYOF_from_invlist(aTHX_ a,b)
++#define rck_elide_nothing(a)	S_rck_elide_nothing(aTHX_ a)
+ #define reg(a,b,c,d)		S_reg(aTHX_ a,b,c,d)
+ #define reg2Lanode(a,b,c,d)	S_reg2Lanode(aTHX_ a,b,c,d)
+ #define reg_node(a,b)		S_reg_node(aTHX_ a,b)
+diff --git a/proto.h b/proto.h
+index fb4ee29508..3d4e01295d 100644
+--- a/proto.h
++++ b/proto.h
+@@ -4821,6 +4821,9 @@ STATIC void	S_parse_lparen_question_flags(pTHX_ RExC_state_t *pRExC_state);
+ STATIC void	S_populate_ANYOF_from_invlist(pTHX_ regnode *node, SV** invlist_ptr);
+ #define PERL_ARGS_ASSERT_POPULATE_ANYOF_FROM_INVLIST	\
+ 	assert(node); assert(invlist_ptr)
++STATIC void	S_rck_elide_nothing(pTHX_ regnode *node);
++#define PERL_ARGS_ASSERT_RCK_ELIDE_NOTHING	\
++	assert(node)
+ PERL_STATIC_NO_RET void	S_re_croak2(pTHX_ bool utf8, const char* pat1, const char* pat2, ...)
+ 			__attribute__noreturn__;
+ #define PERL_ARGS_ASSERT_RE_CROAK2	\
+diff --git a/regcomp.c b/regcomp.c
+index 912e52e3e5..d3452fadc6 100644
+--- a/regcomp.c
++++ b/regcomp.c
+@@ -4165,28 +4165,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+          */
+         JOIN_EXACT(scan,&min_subtract, &unfolded_multi_char, 0);
+ 
+-	/* Follow the next-chain of the current node and optimize
+-	   away all the NOTHINGs from it.  */
+-	if (OP(scan) != CURLYX) {
+-	    const int max = (reg_off_by_arg[OP(scan)]
+-		       ? I32_MAX
+-		       /* I32 may be smaller than U16 on CRAYs! */
+-		       : (I32_MAX < U16_MAX ? I32_MAX : U16_MAX));
+-	    int off = (reg_off_by_arg[OP(scan)] ? ARG(scan) : NEXT_OFF(scan));
+-	    int noff;
+-	    regnode *n = scan;
+-
+-	    /* Skip NOTHING and LONGJMP. */
+-	    while ((n = regnext(n))
+-		   && ((PL_regkind[OP(n)] == NOTHING && (noff = NEXT_OFF(n)))
+-		       || ((OP(n) == LONGJMP) && (noff = ARG(n))))
+-		   && off + noff < max)
+-		off += noff;
+-	    if (reg_off_by_arg[OP(scan)])
+-		ARG(scan) = off;
+-	    else
+-		NEXT_OFF(scan) = off;
+-	}
++        /* Follow the next-chain of the current node and optimize
++           away all the NOTHINGs from it.
++         */
++        rck_elide_nothing(scan);
+ 
+ 	/* The principal pseudo-switch.  Cannot be a switch, since we
+ 	   look into several different things.  */
+@@ -5302,11 +5284,7 @@ Perl_re_printf( aTHX_  "LHS=%"UVuf" RHS=%"UVuf"\n",
+ 		if (data && (fl & SF_HAS_EVAL))
+ 		    data->flags |= SF_HAS_EVAL;
+ 	      optimize_curly_tail:
+-		if (OP(oscan) != CURLYX) {
+-		    while (PL_regkind[OP(next = regnext(oscan))] == NOTHING
+-			   && NEXT_OFF(next))
+-			NEXT_OFF(oscan) += NEXT_OFF(next);
+-		}
++		rck_elide_nothing(oscan);
+ 		continue;
+ 
+ 	    default:
+@@ -6156,6 +6134,44 @@ S_pat_upgrade_to_utf8(pTHX_ RExC_state_t * const pRExC_state,
+     RExC_orig_utf8 = RExC_utf8 = 1;
+ }
+ 
++/* Follow the next-chain of the current node and optimize away
++   all the NOTHINGs from it.
++ */
++STATIC void
++S_rck_elide_nothing(pTHX_ regnode *node)
++{
++    dVAR;
++
++    PERL_ARGS_ASSERT_RCK_ELIDE_NOTHING;
++
++    if (OP(node) != CURLYX) {
++        const int max = (reg_off_by_arg[OP(node)]
++                        ? I32_MAX
++                          /* I32 may be smaller than U16 on CRAYs! */
++                        : (I32_MAX < U16_MAX ? I32_MAX : U16_MAX));
++        int off = (reg_off_by_arg[OP(node)] ? ARG(node) : NEXT_OFF(node));
++        int noff;
++        regnode *n = node;
++
++        /* Skip NOTHING and LONGJMP. */
++        while (
++            (n = regnext(n))
++            && (
++                (PL_regkind[OP(n)] == NOTHING && (noff = NEXT_OFF(n)))
++                || ((OP(n) == LONGJMP) && (noff = ARG(n)))
++            )
++            && off + noff < max
++        ) {
++            off += noff;
++        }
++        if (reg_off_by_arg[OP(node)])
++            ARG(node) = off;
++        else
++            NEXT_OFF(node) = off;
++    }
++    return;
++}
++
+ 
+ 
+ /* S_concat_pat(): concatenate a list of args to the pattern string pat,
diff --git a/debian/patches/fixes/CVE-2020-12723.diff b/debian/patches/fixes/CVE-2020-12723.diff
new file mode 100644
index 0000000000..eb9a99557a
--- /dev/null
+++ b/debian/patches/fixes/CVE-2020-12723.diff
@@ -0,0 +1,281 @@
+From db48e20bb0034a7dca003c8477913fe35657dff8 Mon Sep 17 00:00:00 2001
+From: Hugo van der Sanden <hv@crypt.org>
+Date: Sat, 11 Apr 2020 14:10:24 +0100
+Subject: study_chunk: avoid mutating regexp program within GOSUB
+
+gh16947 and gh17743: studying GOSUB may restudy in an inner call
+(via a mix of recursion and enframing) something that an outer call
+is in the middle of looking at.  Let the outer frame deal with it.
+
+(CVE-2020-12723)
+
+[Backported to 5.24 by Dominic Hargreaves for Debian]
+
+Bug-Debian: https://bugs.debian.org/962005
+Origin: upstream
+Patch-Name: fixes/CVE-2020-12723.diff
+---
+ embed.fnc  |  2 +-
+ embed.h    |  2 +-
+ proto.h    |  2 +-
+ regcomp.c  | 48 ++++++++++++++++++++++++++++++++----------------
+ t/re/pat.t | 26 +++++++++++++++++++++++++-
+ 5 files changed, 60 insertions(+), 20 deletions(-)
+
+diff --git a/embed.fnc b/embed.fnc
+index c4c08cb507..2edd180504 100644
+--- a/embed.fnc
++++ b/embed.fnc
+@@ -2242,7 +2242,7 @@ Es	|SSize_t|study_chunk	|NN RExC_state_t *pRExC_state \
+ 				|NULLOK struct scan_data_t *data \
+                                 |I32 stopparen|U32 recursed_depth \
+ 				|NULLOK regnode_ssc *and_withp \
+-				|U32 flags|U32 depth
++				|U32 flags|U32 depth|bool was_mutate_ok
+ Es	|void	|rck_elide_nothing|NN regnode *node
+ EsRn	|U32	|add_data	|NN RExC_state_t* const pRExC_state \
+ 				|NN const char* const s|const U32 n
+diff --git a/embed.h b/embed.h
+index 9af1fc064e..abf07d2b90 100644
+--- a/embed.h
++++ b/embed.h
+@@ -1057,7 +1057,7 @@
+ #define ssc_is_cp_posixl_init	S_ssc_is_cp_posixl_init
+ #define ssc_or(a,b,c)		S_ssc_or(aTHX_ a,b,c)
+ #define ssc_union(a,b,c)	S_ssc_union(aTHX_ a,b,c)
+-#define study_chunk(a,b,c,d,e,f,g,h,i,j,k)	S_study_chunk(aTHX_ a,b,c,d,e,f,g,h,i,j,k)
++#define study_chunk(a,b,c,d,e,f,g,h,i,j,k,l)	S_study_chunk(aTHX_ a,b,c,d,e,f,g,h,i,j,k,l)
+ #  endif
+ #  if defined(PERL_IN_REGCOMP_C) || defined (PERL_IN_DUMP_C)
+ #define _invlist_dump(a,b,c,d)	Perl__invlist_dump(aTHX_ a,b,c,d)
+diff --git a/proto.h b/proto.h
+index 3d4e01295d..bb73098af4 100644
+--- a/proto.h
++++ b/proto.h
+@@ -4923,7 +4923,7 @@ STATIC void	S_ssc_or(pTHX_ const RExC_state_t *pRExC_state, regnode_ssc *ssc, co
+ PERL_STATIC_INLINE void	S_ssc_union(pTHX_ regnode_ssc *ssc, SV* const invlist, const bool invert_2nd);
+ #define PERL_ARGS_ASSERT_SSC_UNION	\
+ 	assert(ssc); assert(invlist)
+-STATIC SSize_t	S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, SSize_t *minlenp, SSize_t *deltap, regnode *last, struct scan_data_t *data, I32 stopparen, U32 recursed_depth, regnode_ssc *and_withp, U32 flags, U32 depth);
++STATIC SSize_t	S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, SSize_t *minlenp, SSize_t *deltap, regnode *last, struct scan_data_t *data, I32 stopparen, U32 recursed_depth, regnode_ssc *and_withp, U32 flags, U32 depth, bool was_mutate_ok);
+ #define PERL_ARGS_ASSERT_STUDY_CHUNK	\
+ 	assert(pRExC_state); assert(scanp); assert(minlenp); assert(deltap); assert(last)
+ #endif
+diff --git a/regcomp.c b/regcomp.c
+index d3452fadc6..28857eab70 100644
+--- a/regcomp.c
++++ b/regcomp.c
+@@ -119,6 +119,7 @@ typedef struct scan_frame {
+     U32 prev_recursed_depth;
+     I32 stopparen;              /* what stopparen do we use */
+     U32 is_top_frame;           /* what flags do we use? */
++    bool in_gosub;              /* this or an outer frame is for GOSUB */
+ 
+     struct scan_frame *this_prev_frame; /* this previous frame */
+     struct scan_frame *prev_frame;      /* previous frame */
+@@ -4077,7 +4078,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+ 			I32 stopparen,
+                         U32 recursed_depth,
+ 			regnode_ssc *and_withp,
+-			U32 flags, U32 depth)
++			U32 flags, U32 depth, bool was_mutate_ok)
+ 			/* scanp: Start here (read-write). */
+ 			/* deltap: Write maxlen-minlen here. */
+ 			/* last: Stop before this one. */
+@@ -4153,6 +4154,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+                                    node length to get a real minimum (because
+                                    the folded version may be shorter) */
+ 	bool unfolded_multi_char = FALSE;
++        /* avoid mutating ops if we are anywhere within the recursed or
++         * enframed handling for a GOSUB: the outermost level will handle it.
++         */
++        bool mutate_ok = was_mutate_ok && !(frame && frame->in_gosub);
+ 	/* Peephole optimizer: */
+         DEBUG_STUDYDATA("Peep:", data, depth);
+         DEBUG_PEEP("Peep", scan, depth);
+@@ -4163,7 +4168,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+          * parsing code, as each (?:..) is handled by a different invocation of
+          * reg() -- Yves
+          */
+-        JOIN_EXACT(scan,&min_subtract, &unfolded_multi_char, 0);
++        if (mutate_ok)
++            JOIN_EXACT(scan,&min_subtract, &unfolded_multi_char, 0);
+ 
+         /* Follow the next-chain of the current node and optimize
+            away all the NOTHINGs from it.
+@@ -4194,7 +4200,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+              * NOTE we dont use the return here! */
+             (void)study_chunk(pRExC_state, &scan, &minlen,
+                               &deltanext, next, &data_fake, stopparen,
+-                              recursed_depth, NULL, f, depth+1);
++                              recursed_depth, NULL, f, depth+1, mutate_ok);
+ 
+             scan = next;
+         } else
+@@ -4261,7 +4267,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+ 		    /* we suppose the run is continuous, last=next...*/
+ 		    minnext = study_chunk(pRExC_state, &scan, minlenp,
+                                       &deltanext, next, &data_fake, stopparen,
+-                                      recursed_depth, NULL, f,depth+1);
++                                      recursed_depth, NULL, f, depth+1,
++                                      mutate_ok);
+ 
+ 		    if (min1 > minnext)
+ 			min1 = minnext;
+@@ -4328,9 +4335,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+ 		    }
+ 		}
+ 
+-                if (PERL_ENABLE_TRIE_OPTIMISATION &&
+-                        OP( startbranch ) == BRANCH )
+-                {
++                if (PERL_ENABLE_TRIE_OPTIMISATION
++                    && OP(startbranch) == BRANCH
++                    && mutate_ok
++                ) {
+ 		/* demq.
+ 
+                    Assuming this was/is a branch we are dealing with: 'scan'
+@@ -4781,6 +4789,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+                 newframe->stopparen = stopparen;
+                 newframe->prev_recursed_depth = recursed_depth;
+                 newframe->this_prev_frame= frame;
++                newframe->in_gosub = (
++                    (frame && frame->in_gosub) || OP(scan) == GOSUB
++                );
+ 
+                 DEBUG_STUDYDATA("frame-new:",data,depth);
+                 DEBUG_PEEP("fnew", scan, depth);
+@@ -4999,7 +5010,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+                                   (mincount == 0
+                                    ? (f & ~SCF_DO_SUBSTR)
+                                    : f)
+-                                  ,depth+1);
++                                  , depth+1, mutate_ok);
+ 
+ 		if (flags & SCF_DO_STCLASS)
+ 		    data->start_class = oclass;
+@@ -5067,7 +5078,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+ 		if (  OP(oscan) == CURLYX && data
+ 		      && data->flags & SF_IN_PAR
+ 		      && !(data->flags & SF_HAS_EVAL)
+-		      && !deltanext && minnext == 1 ) {
++		      && !deltanext && minnext == 1
++                      && mutate_ok
++                ) {
+ 		    /* Try to optimize to CURLYN.  */
+ 		    regnode *nxt = NEXTOPER(oscan) + EXTRA_STEP_2ARGS;
+ 		    regnode * const nxt1 = nxt;
+@@ -5113,10 +5126,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+ 		      && !(data->flags & SF_HAS_EVAL)
+ 		      && !deltanext	/* atom is fixed width */
+ 		      && minnext != 0	/* CURLYM can't handle zero width */
+-
+                          /* Nor characters whose fold at run-time may be
+                           * multi-character */
+                       && ! (RExC_seen & REG_UNFOLDED_MULTI_SEEN)
++                      && mutate_ok
+ 		) {
+ 		    /* XXXX How to optimize if data == 0? */
+ 		    /* Optimize to a simpler form.  */
+@@ -5163,7 +5176,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
+ #endif
+ 			/* Optimize again: */
+ 			study_chunk(pRExC_state, &nxt1, minlenp, &deltanext, nxt,
+-                                    NULL, stopparen, recursed_depth, NULL, 0,depth+1);
++                                    NULL, stopparen, recursed_depth, NULL, 0,
++                                    depth+1, mutate_ok);
+ 		    }
+ 		    else
+ 			oscan->flags = 0;
+@@ -5544,7 +5558,8 @@ Perl_re_printf( aTHX_  "LHS=%"UVuf" RHS=%"UVuf"\n",
+                 nscan = NEXTOPER(NEXTOPER(scan));
+                 minnext = study_chunk(pRExC_state, &nscan, minlenp, &deltanext,
+                                       last, &data_fake, stopparen,
+-                                      recursed_depth, NULL, f, depth+1);
++                                      recursed_depth, NULL, f, depth+1,
++                                      mutate_ok);
+                 if (scan->flags) {
+                     if (deltanext) {
+ 			FAIL("Variable length lookbehind not implemented");
+@@ -5633,7 +5648,7 @@ Perl_re_printf( aTHX_  "LHS=%"UVuf" RHS=%"UVuf"\n",
+                 *minnextp = study_chunk(pRExC_state, &nscan, minnextp,
+                                         &deltanext, last, &data_fake,
+                                         stopparen, recursed_depth, NULL,
+-                                        f,depth+1);
++                                        f, depth+1, mutate_ok);
+                 if (scan->flags) {
+                     if (deltanext) {
+ 			FAIL("Variable length lookbehind not implemented");
+@@ -5793,7 +5808,8 @@ Perl_re_printf( aTHX_  "LHS=%"UVuf" RHS=%"UVuf"\n",
+                            branches even though they arent otherwise used. */
+                         minnext = study_chunk(pRExC_state, &scan, minlenp,
+                             &deltanext, (regnode *)nextbranch, &data_fake,
+-                            stopparen, recursed_depth, NULL, f,depth+1);
++                            stopparen, recursed_depth, NULL, f, depth+1,
++                            mutate_ok);
+                     }
+                     if (nextbranch && PL_regkind[OP(nextbranch)]==BRANCH)
+                         nextbranch= regnext((regnode*)nextbranch);
+@@ -7480,7 +7496,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
+             &data, -1, 0, NULL,
+             SCF_DO_SUBSTR | SCF_WHILEM_VISITED_POS | stclass_flag
+                           | (restudied ? SCF_TRIE_DOING_RESTUDY : 0),
+-            0);
++            0, TRUE);
+ 
+ 
+         CHECK_RESTUDY_GOTO_butfirst(LEAVE_with_name("study_chunk"));
+@@ -7626,7 +7642,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
+             SCF_DO_STCLASS_AND|SCF_WHILEM_VISITED_POS|(restudied
+                                                       ? SCF_TRIE_DOING_RESTUDY
+                                                       : 0),
+-            0);
++            0, TRUE);
+ 
+         CHECK_RESTUDY_GOTO_butfirst(NOOP);
+ 
+diff --git a/t/re/pat.t b/t/re/pat.t
+index f32e5299f7..225d73e166 100644
+--- a/t/re/pat.t
++++ b/t/re/pat.t
+@@ -23,7 +23,7 @@ BEGIN {
+     skip_all_without_unicode_tables();
+ }
+ 
+-plan tests => 790;  # Update this when adding/deleting tests.
++plan tests => 794;  # Update this when adding/deleting tests.
+ 
+ run_tests() unless caller;
+ 
+@@ -1769,6 +1769,30 @@ EOP
+         ok(scalar($text !~ m{(~*=[a-z]=)}g), "RT #131575");
+     }
+ 
++    # gh16947: test regexp corruption (GOSUB)
++    {
++        fresh_perl_is(q{
++            'xy' =~ /x(?0)|x(?|y|y)/ && print 'ok'
++        }, 'ok', {}, 'gh16947: test regexp corruption (GOSUB)');
++    }
++    # gh16947: test fix doesn't break SUSPEND
++    {
++        fresh_perl_is(q{ 'sx' =~ m{ss++}i; print 'ok' },
++                'ok', {}, "gh16947: test fix doesn't break SUSPEND");
++    }
++
++    # gh17743: more regexp corruption via GOSUB
++    {
++        fresh_perl_is(q{
++            "0" =~ /((0(?0)|000(?|0000|0000)(?0))|)/; print "ok"
++        }, 'ok', {}, 'gh17743: test regexp corruption (1)');
++
++        fresh_perl_is(q{
++            "000000000000" =~ /(0(())(0((?0)())|000(?|\x{ef}\x{bf}\x{bd}|\x{ef}\x{bf}\x{bd}))|)/;
++            print "ok"
++        }, 'ok', {}, 'gh17743: test regexp corruption (2)');
++    }
++
+ } # End of sub run_tests
+ 
+ 1;
diff --git a/debian/patches/fixes/autodie-scope.diff b/debian/patches/fixes/autodie-scope.diff
index a2efa48d96..b2349f3511 100644
--- a/debian/patches/fixes/autodie-scope.diff
+++ b/debian/patches/fixes/autodie-scope.diff
@@ -23,7 +23,7 @@ Patch-Name: fixes/autodie-scope.diff
  create mode 100755 cpan/autodie/t/no-default.t
 
 diff --git a/cpan/autodie/lib/Fatal.pm b/cpan/autodie/lib/Fatal.pm
-index 16e174347..2058abdab 100644
+index 16e1743474..2058abdab0 100644
 --- a/cpan/autodie/lib/Fatal.pm
 +++ b/cpan/autodie/lib/Fatal.pm
 @@ -580,7 +580,12 @@ sub unimport {
@@ -42,7 +42,7 @@ index 16e174347..2058abdab 100644
      }
 diff --git a/cpan/autodie/t/no-all.t b/cpan/autodie/t/no-all.t
 new file mode 100755
-index 000000000..1a503f68b
+index 0000000000..1a503f68be
 --- /dev/null
 +++ b/cpan/autodie/t/no-all.t
 @@ -0,0 +1,22 @@
@@ -70,7 +70,7 @@ index 000000000..1a503f68b
 +1;
 diff --git a/cpan/autodie/t/no-default.t b/cpan/autodie/t/no-default.t
 new file mode 100755
-index 000000000..44d2acf27
+index 0000000000..44d2acf27a
 --- /dev/null
 +++ b/cpan/autodie/t/no-default.t
 @@ -0,0 +1,23 @@
diff --git a/debian/patches/fixes/cpan_web_link.diff b/debian/patches/fixes/cpan_web_link.diff
index fa25e0fcd6..c5c0872feb 100644
--- a/debian/patches/fixes/cpan_web_link.diff
+++ b/debian/patches/fixes/cpan_web_link.diff
@@ -11,7 +11,7 @@ Patch-Name: fixes/cpan_web_link.diff
  1 file changed, 3 insertions(+)
 
 diff --git a/cpan/CPAN/lib/CPAN.pm b/cpan/CPAN/lib/CPAN.pm
-index 25bf3494a..6d11629e4 100644
+index 25bf3494a8..6d11629e40 100644
 --- a/cpan/CPAN/lib/CPAN.pm
 +++ b/cpan/CPAN/lib/CPAN.pm
 @@ -3950,6 +3950,9 @@ your operating system) then typing C<cpan> in a console window will
diff --git a/debian/patches/fixes/crosscompile-no-targethost.diff b/debian/patches/fixes/crosscompile-no-targethost.diff
index 7ef0e071c5..4b54ef136d 100644
--- a/debian/patches/fixes/crosscompile-no-targethost.diff
+++ b/debian/patches/fixes/crosscompile-no-targethost.diff
@@ -21,7 +21,7 @@ Patch-Name: fixes/crosscompile-no-targethost.diff
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Configure b/Configure
-index a00df640e..42f7c21da 100755
+index a00df640e4..42f7c21da7 100755
 --- a/Configure
 +++ b/Configure
 @@ -2972,7 +2972,7 @@ $define|true|[yY]*)
diff --git a/debian/patches/fixes/document_makemaker_ccflags.diff b/debian/patches/fixes/document_makemaker_ccflags.diff
index f799b1e769..4f083390d7 100644
--- a/debian/patches/fixes/document_makemaker_ccflags.diff
+++ b/debian/patches/fixes/document_makemaker_ccflags.diff
@@ -15,7 +15,7 @@ Patch-Name: fixes/document_makemaker_ccflags.diff
  1 file changed, 4 insertions(+)
 
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
-index 42b174fe3..5a9fce22b 100644
+index 42b174fe34..5a9fce22b1 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
 @@ -1771,6 +1771,10 @@ currently used by MakeMaker but may be handy in Makefile.PLs.
diff --git a/debian/patches/fixes/extutils-parsexs-reproducibility.diff b/debian/patches/fixes/extutils-parsexs-reproducibility.diff
index be90dc0357..d0235c144d 100644
--- a/debian/patches/fixes/extutils-parsexs-reproducibility.diff
+++ b/debian/patches/fixes/extutils-parsexs-reproducibility.diff
@@ -12,7 +12,7 @@ Patch-Name: fixes/extutils-parsexs-reproducibility.diff
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
-index 32d74e18e..8c7a6631a 100644
+index 32d74e18e8..8c7a6631a9 100644
 --- a/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
 +++ b/dist/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
 @@ -686,7 +686,7 @@ EOF
diff --git a/debian/patches/fixes/extutils_file_path_compat.diff b/debian/patches/fixes/extutils_file_path_compat.diff
index f2a69e4acd..bb054f77bb 100644
--- a/debian/patches/fixes/extutils_file_path_compat.diff
+++ b/debian/patches/fixes/extutils_file_path_compat.diff
@@ -19,7 +19,7 @@ Patch-Name: fixes/extutils_file_path_compat.diff
  1 file changed, 7 insertions(+), 6 deletions(-)
 
 diff --git a/cpan/ExtUtils-MakeMaker/t/eu_command.t b/cpan/ExtUtils-MakeMaker/t/eu_command.t
-index 269aa5c9a..32a6f59dc 100644
+index 269aa5c9a4..32a6f59dca 100644
 --- a/cpan/ExtUtils-MakeMaker/t/eu_command.t
 +++ b/cpan/ExtUtils-MakeMaker/t/eu_command.t
 @@ -151,20 +151,21 @@ BEGIN {
diff --git a/debian/patches/fixes/extutils_makemaker_reproducible.diff b/debian/patches/fixes/extutils_makemaker_reproducible.diff
index 5a5f727616..3d1d377bb0 100644
--- a/debian/patches/fixes/extutils_makemaker_reproducible.diff
+++ b/debian/patches/fixes/extutils_makemaker_reproducible.diff
@@ -12,7 +12,7 @@ Patch-Name: fixes/extutils_makemaker_reproducible.diff
  2 files changed, 3 insertions(+), 2 deletions(-)
 
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm
-index b4385fc8c..b76f2a425 100644
+index b4385fc8c6..b76f2a4251 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/Command/MM.pm
 @@ -213,7 +213,8 @@ sub perllocal_install {
@@ -26,7 +26,7 @@ index b4385fc8c..b76f2a425 100644
  
   =over 4
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
-index cf4d3e9e3..65cf05af1 100644
+index cf4d3e9e33..65cf05af1e 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 @@ -3682,7 +3682,7 @@ Obsolete, deprecated method. Not used since Version 5.21.
diff --git a/debian/patches/fixes/fbm-instr-crash.diff b/debian/patches/fixes/fbm-instr-crash.diff
index 30e733ccd9..9dfc4fbbd3 100644
--- a/debian/patches/fixes/fbm-instr-crash.diff
+++ b/debian/patches/fixes/fbm-instr-crash.diff
@@ -25,7 +25,7 @@ Patch-Name: fixes/fbm-instr-crash.diff
  3 files changed, 25 insertions(+), 7 deletions(-)
 
 diff --git a/regexec.c b/regexec.c
-index cdaa95cce..4cea7d280 100644
+index cdaa95cce5..4cea7d2801 100644
 --- a/regexec.c
 +++ b/regexec.c
 @@ -127,13 +127,16 @@ static const char* const non_utf8_target_but_utf8_required
@@ -62,7 +62,7 @@ index cdaa95cce..4cea7d280 100644
          if (!start_point)
              goto fail_finish;
 diff --git a/t/re/pat.t b/t/re/pat.t
-index 8652bf65e..f32e5299f 100644
+index 8652bf65e0..f32e5299f7 100644
 --- a/t/re/pat.t
 +++ b/t/re/pat.t
 @@ -23,7 +23,7 @@ BEGIN {
@@ -93,7 +93,7 @@ index 8652bf65e..f32e5299f 100644
  
  1;
 diff --git a/util.c b/util.c
-index 89c44e735..f1315045f 100644
+index 89c44e735d..f1315045fa 100644
 --- a/util.c
 +++ b/util.c
 @@ -806,6 +806,8 @@ Perl_fbm_instr(pTHX_ unsigned char *big, unsigned char *bigend, SV *littlestr, U
diff --git a/debian/patches/fixes/file_path_chmod_race.diff b/debian/patches/fixes/file_path_chmod_race.diff
index fef19dd5fb..b7d433a4c3 100644
--- a/debian/patches/fixes/file_path_chmod_race.diff
+++ b/debian/patches/fixes/file_path_chmod_race.diff
@@ -16,12 +16,12 @@ Bug: https://rt.cpan.org/Public/Bug/Display.html?id=121951
 Bug-Debian: https://bugs.debian.org/863870
 Patch-Name: fixes/file_path_chmod_race.diff
 ---
- cpan/File-Path/lib/File/Path.pm | 39 +++++++++++++++++++++++++--------------
- cpan/File-Path/t/Path.t         | 40 ++++++++++++++++++++++++++--------------
+ cpan/File-Path/lib/File/Path.pm | 39 ++++++++++++++++++++------------
+ cpan/File-Path/t/Path.t         | 40 +++++++++++++++++++++------------
  2 files changed, 51 insertions(+), 28 deletions(-)
 
 diff --git a/cpan/File-Path/lib/File/Path.pm b/cpan/File-Path/lib/File/Path.pm
-index 034da1e57..a824cc8b7 100644
+index 034da1e578..a824cc8b77 100644
 --- a/cpan/File-Path/lib/File/Path.pm
 +++ b/cpan/File-Path/lib/File/Path.pm
 @@ -354,21 +354,32 @@ sub _rmtree {
@@ -72,7 +72,7 @@ index 034da1e57..a824cc8b7 100644
                      next ROOT_DIR;
                  }
 diff --git a/cpan/File-Path/t/Path.t b/cpan/File-Path/t/Path.t
-index ff52fd69e..956ca09e7 100644
+index ff52fd69e3..956ca09e7b 100644
 --- a/cpan/File-Path/t/Path.t
 +++ b/cpan/File-Path/t/Path.t
 @@ -3,7 +3,7 @@
diff --git a/debian/patches/fixes/file_path_hurd_errno.diff b/debian/patches/fixes/file_path_hurd_errno.diff
index f10082e470..b9901e60a4 100644
--- a/debian/patches/fixes/file_path_hurd_errno.diff
+++ b/debian/patches/fixes/file_path_hurd_errno.diff
@@ -9,7 +9,7 @@ Patch-Name: fixes/file_path_hurd_errno.diff
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/cpan/File-Path/t/Path.t b/cpan/File-Path/t/Path.t
-index 5644f57a5..ff52fd69e 100644
+index 5644f57a51..ff52fd69e3 100644
 --- a/cpan/File-Path/t/Path.t
 +++ b/cpan/File-Path/t/Path.t
 @@ -8,6 +8,7 @@ use Config;
diff --git a/debian/patches/fixes/getopt-long-1.diff b/debian/patches/fixes/getopt-long-1.diff
index aab7c5b6e7..b597daabd2 100644
--- a/debian/patches/fixes/getopt-long-1.diff
+++ b/debian/patches/fixes/getopt-long-1.diff
@@ -16,7 +16,7 @@ Patch-Name: fixes/getopt-long-1.diff
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/cpan/Getopt-Long/lib/Getopt/Long.pm b/cpan/Getopt-Long/lib/Getopt/Long.pm
-index fdc96bd20..631912bf9 100644
+index fdc96bd20c..631912bf91 100644
 --- a/cpan/Getopt-Long/lib/Getopt/Long.pm
 +++ b/cpan/Getopt-Long/lib/Getopt/Long.pm
 @@ -1112,7 +1112,7 @@ sub FindOption ($$$$$) {
diff --git a/debian/patches/fixes/getopt-long-2.diff b/debian/patches/fixes/getopt-long-2.diff
index 51138b5866..49b465fb3a 100644
--- a/debian/patches/fixes/getopt-long-2.diff
+++ b/debian/patches/fixes/getopt-long-2.diff
@@ -15,7 +15,7 @@ Patch-Name: fixes/getopt-long-2.diff
  1 file changed, 15 insertions(+), 4 deletions(-)
 
 diff --git a/cpan/Getopt-Long/lib/Getopt/Long.pm b/cpan/Getopt-Long/lib/Getopt/Long.pm
-index 631912bf9..68f090bee 100644
+index 631912bf91..68f090bee7 100644
 --- a/cpan/Getopt-Long/lib/Getopt/Long.pm
 +++ b/cpan/Getopt-Long/lib/Getopt/Long.pm
 @@ -1110,9 +1110,17 @@ sub FindOption ($$$$$) {
diff --git a/debian/patches/fixes/getopt-long-3.diff b/debian/patches/fixes/getopt-long-3.diff
index a6b6e6970c..9a352a3431 100644
--- a/debian/patches/fixes/getopt-long-3.diff
+++ b/debian/patches/fixes/getopt-long-3.diff
@@ -19,7 +19,7 @@ Patch-Name: fixes/getopt-long-3.diff
  1 file changed, 7 insertions(+), 2 deletions(-)
 
 diff --git a/cpan/Getopt-Long/lib/Getopt/Long.pm b/cpan/Getopt-Long/lib/Getopt/Long.pm
-index 68f090bee..9992578aa 100644
+index 68f090bee7..9992578aa8 100644
 --- a/cpan/Getopt-Long/lib/Getopt/Long.pm
 +++ b/cpan/Getopt-Long/lib/Getopt/Long.pm
 @@ -1120,8 +1120,13 @@ sub FindOption ($$$$$) {
diff --git a/debian/patches/fixes/getopt-long-4.diff b/debian/patches/fixes/getopt-long-4.diff
index 4209845dfd..05d4a7e41e 100644
--- a/debian/patches/fixes/getopt-long-4.diff
+++ b/debian/patches/fixes/getopt-long-4.diff
@@ -12,7 +12,7 @@ Patch-Name: fixes/getopt-long-4.diff
  1 file changed, 6 insertions(+)
 
 diff --git a/cpan/Getopt-Long/lib/Getopt/Long.pm b/cpan/Getopt-Long/lib/Getopt/Long.pm
-index 9992578aa..e71fee8d8 100644
+index 9992578aa8..e71fee8d83 100644
 --- a/cpan/Getopt-Long/lib/Getopt/Long.pm
 +++ b/cpan/Getopt-Long/lib/Getopt/Long.pm
 @@ -1121,6 +1121,12 @@ sub FindOption ($$$$$) {
diff --git a/debian/patches/fixes/hurd_hints.diff b/debian/patches/fixes/hurd_hints.diff
index ce4c833ed1..9cc07fad7c 100644
--- a/debian/patches/fixes/hurd_hints.diff
+++ b/debian/patches/fixes/hurd_hints.diff
@@ -16,7 +16,7 @@ Patch-Name: fixes/hurd_hints.diff
  1 file changed, 29 insertions(+), 4 deletions(-)
 
 diff --git a/hints/gnu.sh b/hints/gnu.sh
-index fe251cbc9..8ec947018 100644
+index fe251cbc90..8ec9470183 100644
 --- a/hints/gnu.sh
 +++ b/hints/gnu.sh
 @@ -1,6 +1,5 @@
diff --git a/debian/patches/fixes/hurd_sigaction.diff b/debian/patches/fixes/hurd_sigaction.diff
index b2595ba12f..741673ffad 100644
--- a/debian/patches/fixes/hurd_sigaction.diff
+++ b/debian/patches/fixes/hurd_sigaction.diff
@@ -16,7 +16,7 @@ Patch-Name: fixes/hurd_sigaction.diff
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/ext/POSIX/t/sigaction.t b/ext/POSIX/t/sigaction.t
-index d19341c24..bce3b7661 100644
+index d19341c246..bce3b76615 100644
 --- a/ext/POSIX/t/sigaction.t
 +++ b/ext/POSIX/t/sigaction.t
 @@ -202,7 +202,9 @@ SKIP: {
diff --git a/debian/patches/fixes/io-socket-ip-nov4.diff b/debian/patches/fixes/io-socket-ip-nov4.diff
new file mode 100644
index 0000000000..4284019c5f
--- /dev/null
+++ b/debian/patches/fixes/io-socket-ip-nov4.diff
@@ -0,0 +1,266 @@
+From e5a5e4056884afc8bf630675094fad92e409a30b Mon Sep 17 00:00:00 2001
+From: Dominic Hargreaves <dom@earth.li>
+Date: Wed, 3 Jun 2020 22:38:09 +0100
+Subject: Fix test failures in IO::Socket::IP with an IPv6-only host
+
+This can be tested with:
+
+    # unshare -n
+    # ip li set lo up
+    # ip li add dummy0 type dummy
+    # ip li set dummy0 up
+
+Thanks to Julien Cristau and Niko Tyni for contributing the basis
+of the patch and test instructions.
+
+[Backported to 5.24 with minor changes]
+
+Bug-Debian: https://bugs.debian.org/962019
+Forwarded: https://rt.cpan.org/Ticket/Display.html?id=132760
+Patch-Name: fixes/io-socket-ip-nov4.diff
+---
+ cpan/IO-Socket-IP/t/01local-client-v4.t     | 4 +++-
+ cpan/IO-Socket-IP/t/02local-server-v4.t     | 3 ++-
+ cpan/IO-Socket-IP/t/03local-cross-v4.t      | 3 +++
+ cpan/IO-Socket-IP/t/11sockopts.t            | 5 ++++-
+ cpan/IO-Socket-IP/t/18fdopen.t              | 3 ++-
+ cpan/IO-Socket-IP/t/20subclass.t            | 3 +++
+ cpan/IO-Socket-IP/t/21as-inet.t             | 3 +++
+ cpan/IO-Socket-IP/t/22timeout.t             | 3 +++
+ cpan/IO-Socket-IP/t/30nonblocking-connect.t | 4 +++-
+ 9 files changed, 26 insertions(+), 5 deletions(-)
+
+diff --git a/cpan/IO-Socket-IP/t/01local-client-v4.t b/cpan/IO-Socket-IP/t/01local-client-v4.t
+index 7ab7156993..f6aeac4c3b 100644
+--- a/cpan/IO-Socket-IP/t/01local-client-v4.t
++++ b/cpan/IO-Socket-IP/t/01local-client-v4.t
+@@ -8,7 +8,7 @@ use Test::More;
+ use IO::Socket::IP;
+ 
+ use IO::Socket::INET;
+-use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in );
++use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in AI_NUMERICHOST );
+ 
+ # Some odd locations like BSD jails might not like INADDR_LOOPBACK. We'll
+ # establish a baseline first to test against
+@@ -29,12 +29,14 @@ foreach my $socktype (qw( SOCK_STREAM SOCK_DGRAM )) {
+       LocalHost => "127.0.0.1",
+       Type      => Socket->$socktype,
+       Proto     => ( $socktype eq "SOCK_STREAM" ? "tcp" : "udp" ), # Because IO::Socket::INET is stupid and always presumes tcp
++      GetAddrInfoFlags => AI_NUMERICHOST,
+    ) or die "Cannot listen on PF_INET - $@";
+ 
+    my $socket = IO::Socket::IP->new(
+       PeerHost    => "127.0.0.1",
+       PeerService => $testserver->sockport,
+       Type        => Socket->$socktype,
++      GetAddrInfoFlags => AI_NUMERICHOST,
+    );
+ 
+    ok( defined $socket, "IO::Socket::IP->new constructs a $socktype socket" ) or
+diff --git a/cpan/IO-Socket-IP/t/02local-server-v4.t b/cpan/IO-Socket-IP/t/02local-server-v4.t
+index c0d349f573..fb711f08bd 100644
+--- a/cpan/IO-Socket-IP/t/02local-server-v4.t
++++ b/cpan/IO-Socket-IP/t/02local-server-v4.t
+@@ -8,7 +8,7 @@ use Test::More;
+ use IO::Socket::IP;
+ 
+ use IO::Socket::INET;
+-use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in );
++use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in AI_NUMERICHOST );
+ 
+ # Some odd locations like BSD jails might not like INADDR_LOOPBACK. We'll
+ # establish a baseline first to test against
+@@ -29,6 +29,7 @@ foreach my $socktype (qw( SOCK_STREAM SOCK_DGRAM )) {
+       LocalHost => "127.0.0.1",
+       LocalPort => "0",
+       Type      => Socket->$socktype,
++      GetAddrInfoFlags => AI_NUMERICHOST,
+    );
+ 
+    ok( defined $testserver, "IO::Socket::IP->new constructs a $socktype socket" ) or
+diff --git a/cpan/IO-Socket-IP/t/03local-cross-v4.t b/cpan/IO-Socket-IP/t/03local-cross-v4.t
+index 8cac72a95b..3e8174ee08 100644
+--- a/cpan/IO-Socket-IP/t/03local-cross-v4.t
++++ b/cpan/IO-Socket-IP/t/03local-cross-v4.t
+@@ -6,6 +6,7 @@ use warnings;
+ use Test::More;
+ 
+ use IO::Socket::IP;
++use Socket qw(AI_NUMERICHOST);
+ 
+ foreach my $socktype (qw( SOCK_STREAM SOCK_DGRAM )) {
+    my $testserver = IO::Socket::IP->new(
+@@ -13,12 +14,14 @@ foreach my $socktype (qw( SOCK_STREAM SOCK_DGRAM )) {
+       LocalHost => "127.0.0.1",
+       LocalPort => "0",
+       Type      => Socket->$socktype,
++      GetAddrInfoFlags => AI_NUMERICHOST,
+    ) or die "Cannot listen on PF_INET - $@";
+ 
+    my $socket = IO::Socket::IP->new(
+       PeerHost    => "127.0.0.1",
+       PeerService => $testserver->sockport,
+       Type        => Socket->$socktype,
++      GetAddrInfoFlags => AI_NUMERICHOST,
+    ) or die "Cannot connect on PF_INET - $@";
+ 
+    my $testclient = ( $socktype eq "SOCK_STREAM" ) ? 
+diff --git a/cpan/IO-Socket-IP/t/11sockopts.t b/cpan/IO-Socket-IP/t/11sockopts.t
+index 90f92ae7bd..856ff28f4e 100644
+--- a/cpan/IO-Socket-IP/t/11sockopts.t
++++ b/cpan/IO-Socket-IP/t/11sockopts.t
+@@ -8,7 +8,7 @@ use Test::More;
+ use IO::Socket::IP;
+ 
+ use Errno qw( EACCES );
+-use Socket qw( SOL_SOCKET SO_REUSEADDR SO_REUSEPORT SO_BROADCAST );
++use Socket qw( SOL_SOCKET SO_REUSEADDR SO_REUSEPORT SO_BROADCAST AI_NUMERICHOST);
+ 
+ TODO: {
+    local $TODO = "SO_REUSEADDR doesn't appear to work on cygwin smokers" if $^O eq "cygwin";
+@@ -21,6 +21,7 @@ TODO: {
+       Type      => SOCK_STREAM,
+       Listen    => 1,
+       ReuseAddr => 1,
++      GetAddrInfoFlags => AI_NUMERICHOST,
+    ) or die "Cannot socket() - $@";
+ 
+    ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEADDR ), 'SO_REUSEADDR set' );
+@@ -39,6 +40,7 @@ SKIP: {
+       Type      => SOCK_STREAM,
+       Listen    => 1,
+       ReusePort => 1,
++      GetAddrInfoFlags => AI_NUMERICHOST,
+    ) or die "Cannot socket() - $@";
+ 
+    ok( $sock->getsockopt( SOL_SOCKET, SO_REUSEPORT ), 'SO_REUSEPORT set' );
+@@ -51,6 +53,7 @@ SKIP: {
+       LocalHost => "127.0.0.1",
+       Type      => SOCK_DGRAM,
+       Broadcast => 1,
++      GetAddrInfoFlags => AI_NUMERICHOST,
+    );
+    skip "Privileges required to set broadcast on datagram socket", 1 if !$sock and $! == EACCES;
+    die "Cannot socket() - $@" unless $sock;
+diff --git a/cpan/IO-Socket-IP/t/18fdopen.t b/cpan/IO-Socket-IP/t/18fdopen.t
+index 20cbe46d47..6843a2c3d2 100644
+--- a/cpan/IO-Socket-IP/t/18fdopen.t
++++ b/cpan/IO-Socket-IP/t/18fdopen.t
+@@ -6,12 +6,13 @@ use warnings;
+ use Test::More;
+ 
+ use IO::Socket::IP;
+-use Socket qw( SOCK_STREAM );
++use Socket qw( SOCK_STREAM AI_NUMERICHOST );
+ 
+ my $s1 = IO::Socket::IP->new(
+    LocalHost => "127.0.0.1",
+    Type      => SOCK_STREAM,
+    Listen    => 1,
++   GetAddrInfoFlags => AI_NUMERICHOST,
+ ) or die "Cannot listen on AF_INET - $@";
+ 
+ my $s2 = IO::Socket::IP->new;
+diff --git a/cpan/IO-Socket-IP/t/20subclass.t b/cpan/IO-Socket-IP/t/20subclass.t
+index 231bd52cab..fbc9cff23e 100644
+--- a/cpan/IO-Socket-IP/t/20subclass.t
++++ b/cpan/IO-Socket-IP/t/20subclass.t
+@@ -6,16 +6,19 @@ use warnings;
+ use Test::More;
+ 
+ use IO::Socket::IP;
++use Socket qw( AI_NUMERICHOST );
+ 
+ my $server = IO::Socket::IP->new(
+    Listen    => 1,
+    LocalHost => "127.0.0.1",
+    LocalPort => 0,
++   GetAddrInfoFlags => AI_NUMERICHOST,
+ ) or die "Cannot listen on PF_INET - $!";
+ 
+ my $client = IO::Socket::IP->new(
+    PeerHost => $server->sockhost,
+    PeerPort => $server->sockport,
++   GetAddrInfoFlags => AI_NUMERICHOST,
+ ) or die "Cannot connect on PF_INET - $!";
+ 
+ my $accepted = $server->accept( 'MySubclass' )
+diff --git a/cpan/IO-Socket-IP/t/21as-inet.t b/cpan/IO-Socket-IP/t/21as-inet.t
+index 2b8713d46f..fedb8be538 100644
+--- a/cpan/IO-Socket-IP/t/21as-inet.t
++++ b/cpan/IO-Socket-IP/t/21as-inet.t
+@@ -6,16 +6,19 @@ use warnings;
+ use Test::More;
+ 
+ use IO::Socket::IP;
++use Socket qw( AI_NUMERICHOST );
+ 
+ my $server = IO::Socket::IP->new(
+    Listen    => 1,
+    LocalHost => "127.0.0.1",
+    LocalPort => 0,
++   GetAddrInfoFlags => AI_NUMERICHOST,
+ ) or die "Cannot listen on PF_INET - $!";
+ 
+ my $client = IO::Socket::IP->new(
+    PeerHost => $server->sockhost,
+    PeerPort => $server->sockport,
++   GetAddrInfoFlags => AI_NUMERICHOST,
+ ) or die "Cannot connect on PF_INET - $!";
+ 
+ my $accepted = $server->accept
+diff --git a/cpan/IO-Socket-IP/t/22timeout.t b/cpan/IO-Socket-IP/t/22timeout.t
+index a4c28b3af0..c4a08f5d1f 100644
+--- a/cpan/IO-Socket-IP/t/22timeout.t
++++ b/cpan/IO-Socket-IP/t/22timeout.t
+@@ -6,17 +6,20 @@ use warnings;
+ use Test::More;
+ 
+ use IO::Socket::IP;
++use Socket qw( AI_NUMERICHOST );
+ 
+ my $server = IO::Socket::IP->new(
+    Listen    => 1,
+    LocalHost => "127.0.0.1",
+    LocalPort => 0,
++   GetAddrInfoFlags => AI_NUMERICHOST,
+ ) or die "Cannot listen on PF_INET - $!";
+ 
+ my $client = IO::Socket::IP->new(
+    PeerHost => $server->sockhost,
+    PeerPort => $server->sockport,
+    Timeout  => 0.1,
++   GetAddrInfoFlags => AI_NUMERICHOST,
+ ) or die "Cannot connect on PF_INET - $!";
+ 
+ ok( defined $client, 'client constructed with Timeout' );
+diff --git a/cpan/IO-Socket-IP/t/30nonblocking-connect.t b/cpan/IO-Socket-IP/t/30nonblocking-connect.t
+index 518bd2ebd8..ade8349354 100644
+--- a/cpan/IO-Socket-IP/t/30nonblocking-connect.t
++++ b/cpan/IO-Socket-IP/t/30nonblocking-connect.t
+@@ -8,7 +8,7 @@ use Test::More;
+ use IO::Socket::IP;
+ 
+ use IO::Socket::INET;
+-use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in );
++use Socket qw( inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in AI_NUMERICHOST );
+ use Errno qw( EINPROGRESS EWOULDBLOCK );
+ 
+ # Some odd locations like BSD jails might not like INADDR_LOOPBACK. We'll
+@@ -27,6 +27,7 @@ my $testserver = IO::Socket::INET->new(
+    Listen    => 1,
+    LocalHost => "127.0.0.1",
+    Type      => SOCK_STREAM,
++   GetAddrInfoFlags => AI_NUMERICHOST,
+ ) or die "Cannot listen on PF_INET - $@";
+ 
+ my $socket = IO::Socket::IP->new(
+@@ -34,6 +35,7 @@ my $socket = IO::Socket::IP->new(
+    PeerService => $testserver->sockport,
+    Type        => SOCK_STREAM,
+    Blocking    => 0,
++   GetAddrInfoFlags => AI_NUMERICHOST,
+ );
+ 
+ ok( defined $socket, 'IO::Socket::IP->new( Blocking => 0 ) constructs a socket' ) or
diff --git a/debian/patches/fixes/list_assign_leak.diff b/debian/patches/fixes/list_assign_leak.diff
index 4297179ff5..332461d85f 100644
--- a/debian/patches/fixes/list_assign_leak.diff
+++ b/debian/patches/fixes/list_assign_leak.diff
@@ -58,7 +58,7 @@ Patch-Name: fixes/list_assign_leak.diff
  1 file changed, 2 insertions(+), 1 deletion(-)
 
 diff --git a/pp_hot.c b/pp_hot.c
-index d6cb1aa09..243f43a97 100644
+index d6cb1aa091..243f43a972 100644
 --- a/pp_hot.c
 +++ b/pp_hot.c
 @@ -1181,6 +1181,7 @@ S_aassign_copy_common(pTHX_ SV **firstlelem, SV **lastlelem,
diff --git a/debian/patches/fixes/longdblinf-randomness.diff b/debian/patches/fixes/longdblinf-randomness.diff
index 726404866c..c45c063b5c 100644
--- a/debian/patches/fixes/longdblinf-randomness.diff
+++ b/debian/patches/fixes/longdblinf-randomness.diff
@@ -18,7 +18,7 @@ Patch-Name: fixes/longdblinf-randomness.diff
  1 file changed, 6 insertions(+), 8 deletions(-)
 
 diff --git a/Configure b/Configure
-index 42f7c21da..bdb243640 100755
+index 42f7c21da7..bdb2436409 100755
 --- a/Configure
 +++ b/Configure
 @@ -20470,8 +20470,8 @@ $cat >try.c <<EOP
diff --git a/debian/patches/fixes/math_complex_doc_angle_units.diff b/debian/patches/fixes/math_complex_doc_angle_units.diff
index 92933e4bec..2e8ceacb91 100644
--- a/debian/patches/fixes/math_complex_doc_angle_units.diff
+++ b/debian/patches/fixes/math_complex_doc_angle_units.diff
@@ -11,7 +11,7 @@ Patch-Name: fixes/math_complex_doc_angle_units.diff
  1 file changed, 5 insertions(+)
 
 diff --git a/cpan/Math-Complex/lib/Math/Trig.pm b/cpan/Math-Complex/lib/Math/Trig.pm
-index acad31ff4..bc7ac780e 100644
+index acad31ff49..bc7ac780e9 100644
 --- a/cpan/Math-Complex/lib/Math/Trig.pm
 +++ b/cpan/Math-Complex/lib/Math/Trig.pm
 @@ -263,6 +263,11 @@ core Perl which defines only the C<sin()> and C<cos()>.  The constant
diff --git a/debian/patches/fixes/math_complex_doc_great_circle.diff b/debian/patches/fixes/math_complex_doc_great_circle.diff
index fede0687cb..483cd9acf5 100644
--- a/debian/patches/fixes/math_complex_doc_great_circle.diff
+++ b/debian/patches/fixes/math_complex_doc_great_circle.diff
@@ -11,7 +11,7 @@ Patch-Name: fixes/math_complex_doc_great_circle.diff
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/cpan/Math-Complex/lib/Math/Trig.pm b/cpan/Math-Complex/lib/Math/Trig.pm
-index 1d9612a41..efc2ff80a 100644
+index 1d9612a41c..efc2ff80ac 100644
 --- a/cpan/Math-Complex/lib/Math/Trig.pm
 +++ b/cpan/Math-Complex/lib/Math/Trig.pm
 @@ -608,7 +608,7 @@ or the midpoint if you know the end points:
diff --git a/debian/patches/fixes/math_complex_doc_see_also.diff b/debian/patches/fixes/math_complex_doc_see_also.diff
index 17fbd54b20..2e588ceb9e 100644
--- a/debian/patches/fixes/math_complex_doc_see_also.diff
+++ b/debian/patches/fixes/math_complex_doc_see_also.diff
@@ -11,7 +11,7 @@ Patch-Name: fixes/math_complex_doc_see_also.diff
  1 file changed, 2 insertions(+)
 
 diff --git a/cpan/Math-Complex/lib/Math/Trig.pm b/cpan/Math-Complex/lib/Math/Trig.pm
-index efc2ff80a..acad31ff4 100644
+index efc2ff80ac..acad31ff49 100644
 --- a/cpan/Math-Complex/lib/Math/Trig.pm
 +++ b/cpan/Math-Complex/lib/Math/Trig.pm
 @@ -743,6 +743,8 @@ an answer instead of giving a fatal runtime error.
diff --git a/debian/patches/fixes/memoize-pod.diff b/debian/patches/fixes/memoize-pod.diff
index 2114dea0e9..caa4bde151 100644
--- a/debian/patches/fixes/memoize-pod.diff
+++ b/debian/patches/fixes/memoize-pod.diff
@@ -11,7 +11,7 @@ Patch-Name: fixes/memoize-pod.diff
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/cpan/Memoize/Memoize.pm b/cpan/Memoize/Memoize.pm
-index f4e6522d4..2f28b361f 100644
+index f4e6522d48..2f28b361f8 100644
 --- a/cpan/Memoize/Memoize.pm
 +++ b/cpan/Memoize/Memoize.pm
 @@ -752,6 +752,8 @@ cache that was populated by the first call.  C<complicated> ends up
diff --git a/debian/patches/fixes/memoize_storable_nstore.diff b/debian/patches/fixes/memoize_storable_nstore.diff
index 15435a210a..3d9d24d823 100644
--- a/debian/patches/fixes/memoize_storable_nstore.diff
+++ b/debian/patches/fixes/memoize_storable_nstore.diff
@@ -53,7 +53,7 @@ Patch-Name: fixes/memoize_storable_nstore.diff
  2 files changed, 21 insertions(+), 5 deletions(-)
 
 diff --git a/cpan/Memoize/Memoize/Storable.pm b/cpan/Memoize/Memoize/Storable.pm
-index 131479729..87876f227 100644
+index 1314797297..87876f227e 100644
 --- a/cpan/Memoize/Memoize/Storable.pm
 +++ b/cpan/Memoize/Memoize/Storable.pm
 @@ -55,7 +55,7 @@ sub DESTROY {
@@ -66,7 +66,7 @@ index 131479729..87876f227 100644
    } else {
      Storable::store($self->{H}, $self->{FILENAME});
 diff --git a/cpan/Memoize/t/tie_storable.t b/cpan/Memoize/t/tie_storable.t
-index de3b8dc26..a62423850 100644
+index de3b8dc26b..a62423850e 100644
 --- a/cpan/Memoize/t/tie_storable.t
 +++ b/cpan/Memoize/t/tie_storable.t
 @@ -31,18 +31,34 @@ if ($@) {
diff --git a/debian/patches/fixes/net_smtp_docs.diff b/debian/patches/fixes/net_smtp_docs.diff
index 968958b917..a5261838fb 100644
--- a/debian/patches/fixes/net_smtp_docs.diff
+++ b/debian/patches/fixes/net_smtp_docs.diff
@@ -12,7 +12,7 @@ Patch-Name: fixes/net_smtp_docs.diff
  1 file changed, 1 insertion(+)
 
 diff --git a/cpan/libnet/lib/Net/SMTP.pm b/cpan/libnet/lib/Net/SMTP.pm
-index 0130a2fd6..05dfbf941 100644
+index 0130a2fd64..05dfbf941b 100644
 --- a/cpan/libnet/lib/Net/SMTP.pm
 +++ b/cpan/libnet/lib/Net/SMTP.pm
 @@ -752,6 +752,7 @@ Net::SMTP will attempt to extract the address from the value passed.
diff --git a/debian/patches/fixes/nntp_docs.diff b/debian/patches/fixes/nntp_docs.diff
index 27dbc0df9e..f1b282280d 100644
--- a/debian/patches/fixes/nntp_docs.diff
+++ b/debian/patches/fixes/nntp_docs.diff
@@ -14,7 +14,7 @@ Patch-Name: fixes/nntp_docs.diff
  1 file changed, 3 insertions(+), 3 deletions(-)
 
 diff --git a/cpan/libnet/lib/Net/NNTP.pm b/cpan/libnet/lib/Net/NNTP.pm
-index 675b1e6a5..e043b3b76 100644
+index 675b1e6a5c..e043b3b763 100644
 --- a/cpan/libnet/lib/Net/NNTP.pm
 +++ b/cpan/libnet/lib/Net/NNTP.pm
 @@ -845,10 +845,10 @@ NNTP server, a value of zero will cause all IO operations to block.
diff --git a/debian/patches/fixes/ok-pod.diff b/debian/patches/fixes/ok-pod.diff
index fdd53f4f1d..9dcec63fb3 100644
--- a/debian/patches/fixes/ok-pod.diff
+++ b/debian/patches/fixes/ok-pod.diff
@@ -11,7 +11,7 @@ Patch-Name: fixes/ok-pod.diff
  1 file changed, 4 insertions(+)
 
 diff --git a/cpan/Test-Simple/lib/ok.pm b/cpan/Test-Simple/lib/ok.pm
-index 02726ac96..9dc9ea235 100644
+index 02726ac964..9dc9ea235b 100644
 --- a/cpan/Test-Simple/lib/ok.pm
 +++ b/cpan/Test-Simple/lib/ok.pm
 @@ -20,6 +20,10 @@ sub import {
diff --git a/debian/patches/fixes/perlbug-linewrap.diff b/debian/patches/fixes/perlbug-linewrap.diff
index 38cae2e262..906546f43b 100644
--- a/debian/patches/fixes/perlbug-linewrap.diff
+++ b/debian/patches/fixes/perlbug-linewrap.diff
@@ -32,7 +32,7 @@ Patch-Name: fixes/perlbug-linewrap.diff
  1 file changed, 12 insertions(+), 1 deletion(-)
 
 diff --git a/utils/perlbug.PL b/utils/perlbug.PL
-index 100bc022e..235313b6d 100644
+index 100bc022e8..235313b6dd 100644
 --- a/utils/perlbug.PL
 +++ b/utils/perlbug.PL
 @@ -77,6 +77,8 @@ BEGIN {
diff --git a/debian/patches/fixes/perlbug-refactor.diff b/debian/patches/fixes/perlbug-refactor.diff
index c61071895a..f2c290728d 100644
--- a/debian/patches/fixes/perlbug-refactor.diff
+++ b/debian/patches/fixes/perlbug-refactor.diff
@@ -16,7 +16,7 @@ Patch-Name: fixes/perlbug-refactor.diff
  1 file changed, 13 insertions(+), 12 deletions(-)
 
 diff --git a/utils/perlbug.PL b/utils/perlbug.PL
-index ae8c34305..100bc022e 100644
+index ae8c343052..100bc022e8 100644
 --- a/utils/perlbug.PL
 +++ b/utils/perlbug.PL
 @@ -835,10 +835,7 @@ EOF
diff --git a/debian/patches/fixes/perlfunc_inc_doc.diff b/debian/patches/fixes/perlfunc_inc_doc.diff
index 10384da68b..b4071a7277 100644
--- a/debian/patches/fixes/perlfunc_inc_doc.diff
+++ b/debian/patches/fixes/perlfunc_inc_doc.diff
@@ -12,7 +12,7 @@ Patch-Name: fixes/perlfunc_inc_doc.diff
  1 file changed, 19 insertions(+), 9 deletions(-)
 
 diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
-index e9c7038a9..09c9b6a3e 100644
+index e9c7038a9c..09c9b6a3ea 100644
 --- a/pod/perlfunc.pod
 +++ b/pod/perlfunc.pod
 @@ -1808,20 +1808,30 @@ X<do>
diff --git a/debian/patches/fixes/respect_umask.diff b/debian/patches/fixes/respect_umask.diff
index 73d472cc11..035ff27f10 100644
--- a/debian/patches/fixes/respect_umask.diff
+++ b/debian/patches/fixes/respect_umask.diff
@@ -8,12 +8,12 @@ site directories.
 
 Patch-Name: fixes/respect_umask.diff
 ---
- cpan/ExtUtils-Install/lib/ExtUtils/Install.pm   | 18 +++++++++---------
- cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 18 +++++++++---------
+ cpan/ExtUtils-Install/lib/ExtUtils/Install.pm  | 18 +++++++++---------
+ .../ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 18 +++++++++---------
  2 files changed, 18 insertions(+), 18 deletions(-)
 
 diff --git a/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm b/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
-index 1e8ac4cd1..3e79121f3 100644
+index 1e8ac4cd12..3e79121f38 100644
 --- a/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
 +++ b/cpan/ExtUtils-Install/lib/ExtUtils/Install.pm
 @@ -451,7 +451,7 @@ sub _can_write_dir {
@@ -88,7 +88,7 @@ index 1e8ac4cd1..3e79121f3 100644
          if ($need_filtering) {
              run_filter($pm_filter, $from, $to);
 diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
-index 009b18ee0..1f4542e9d 100644
+index 009b18ee08..1f4542e9da 100644
 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
 @@ -2119,7 +2119,7 @@ doc__install : doc_site_install
diff --git a/debian/patches/fixes/test-builder-warning.diff b/debian/patches/fixes/test-builder-warning.diff
index 137be9cdc2..4cfd4884eb 100644
--- a/debian/patches/fixes/test-builder-warning.diff
+++ b/debian/patches/fixes/test-builder-warning.diff
@@ -18,7 +18,7 @@ Patch-Name: fixes/test-builder-warning.diff
  1 file changed, 1 insertion(+)
 
 diff --git a/cpan/Test-Simple/lib/Test/Builder.pm b/cpan/Test-Simple/lib/Test/Builder.pm
-index a8e7bd95b..c1dba1c66 100644
+index a8e7bd95b1..c1dba1c66b 100644
 --- a/cpan/Test-Simple/lib/Test/Builder.pm
 +++ b/cpan/Test-Simple/lib/Test/Builder.pm
 @@ -2246,6 +2246,7 @@ sub find_TODO {
diff --git a/debian/patches/fixes/time-local-2020.diff b/debian/patches/fixes/time-local-2020.diff
index b5aa2bd2fc..38f8ba84f3 100644
--- a/debian/patches/fixes/time-local-2020.diff
+++ b/debian/patches/fixes/time-local-2020.diff
@@ -17,7 +17,7 @@ Patch-Name: fixes/time-local-2020.diff
  1 file changed, 5 insertions(+), 6 deletions(-)
 
 diff --git a/cpan/Time-Local/t/Local.t b/cpan/Time-Local/t/Local.t
-index 472e71a2d..0a852a0f4 100644
+index 472e71a2df..0a852a0f45 100644
 --- a/cpan/Time-Local/t/Local.t
 +++ b/cpan/Time-Local/t/Local.t
 @@ -91,7 +91,7 @@ for (@time, @neg_time) {
diff --git a/debian/patches/fixes/time_piece_doc.diff b/debian/patches/fixes/time_piece_doc.diff
index 385c9dbfd6..0f4fbb0ded 100644
--- a/debian/patches/fixes/time_piece_doc.diff
+++ b/debian/patches/fixes/time_piece_doc.diff
@@ -14,7 +14,7 @@ Patch-Name: fixes/time_piece_doc.diff
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/cpan/Time-Piece/Piece.pm b/cpan/Time-Piece/Piece.pm
-index 6dbf4d69c..d3b62ce5f 100644
+index 6dbf4d69c4..d3b62ce5fb 100644
 --- a/cpan/Time-Piece/Piece.pm
 +++ b/cpan/Time-Piece/Piece.pm
 @@ -783,8 +783,8 @@ days, weeks and years in that delta, using the Time::Seconds API.
diff --git a/debian/patches/series b/debian/patches/series
index 7b287d0df9..9c3b37d4e1 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -84,3 +84,7 @@ fixes/CVE-2018-18312.diff
 fixes/CVE-2018-18313.diff
 fixes/CVE-2018-18314.diff
 fixes/time-local-2020.diff
+fixes/CVE-2020-10543.diff
+fixes/CVE-2020-10878.diff
+fixes/CVE-2020-12723.diff
+fixes/io-socket-ip-nov4.diff
diff --git a/embed.fnc b/embed.fnc
index a64ffbac74..2edd180504 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2242,7 +2242,8 @@ Es	|SSize_t|study_chunk	|NN RExC_state_t *pRExC_state \
 				|NULLOK struct scan_data_t *data \
                                 |I32 stopparen|U32 recursed_depth \
 				|NULLOK regnode_ssc *and_withp \
-				|U32 flags|U32 depth
+				|U32 flags|U32 depth|bool was_mutate_ok
+Es	|void	|rck_elide_nothing|NN regnode *node
 EsRn	|U32	|add_data	|NN RExC_state_t* const pRExC_state \
 				|NN const char* const s|const U32 n
 rs	|void	|re_croak2	|bool utf8|NN const char* pat1|NN const char* pat2|...
diff --git a/embed.h b/embed.h
index 42c65b2eb0..abf07d2b90 100644
--- a/embed.h
+++ b/embed.h
@@ -1026,6 +1026,7 @@
 #define output_or_return_posix_warnings(a,b,c)	S_output_or_return_posix_warnings(aTHX_ a,b,c)
 #define parse_lparen_question_flags(a)	S_parse_lparen_question_flags(aTHX_ a)
 #define populate_ANYOF_from_invlist(a,b)	S_populate_ANYOF_from_invlist(aTHX_ a,b)
+#define rck_elide_nothing(a)	S_rck_elide_nothing(aTHX_ a)
 #define reg(a,b,c,d)		S_reg(aTHX_ a,b,c,d)
 #define reg2Lanode(a,b,c,d)	S_reg2Lanode(aTHX_ a,b,c,d)
 #define reg_node(a,b)		S_reg_node(aTHX_ a,b)
@@ -1056,7 +1057,7 @@
 #define ssc_is_cp_posixl_init	S_ssc_is_cp_posixl_init
 #define ssc_or(a,b,c)		S_ssc_or(aTHX_ a,b,c)
 #define ssc_union(a,b,c)	S_ssc_union(aTHX_ a,b,c)
-#define study_chunk(a,b,c,d,e,f,g,h,i,j,k)	S_study_chunk(aTHX_ a,b,c,d,e,f,g,h,i,j,k)
+#define study_chunk(a,b,c,d,e,f,g,h,i,j,k,l)	S_study_chunk(aTHX_ a,b,c,d,e,f,g,h,i,j,k,l)
 #  endif
 #  if defined(PERL_IN_REGCOMP_C) || defined (PERL_IN_DUMP_C)
 #define _invlist_dump(a,b,c,d)	Perl__invlist_dump(aTHX_ a,b,c,d)
diff --git a/proto.h b/proto.h
index fb4ee29508..bb73098af4 100644
--- a/proto.h
+++ b/proto.h
@@ -4821,6 +4821,9 @@ STATIC void	S_parse_lparen_question_flags(pTHX_ RExC_state_t *pRExC_state);
 STATIC void	S_populate_ANYOF_from_invlist(pTHX_ regnode *node, SV** invlist_ptr);
 #define PERL_ARGS_ASSERT_POPULATE_ANYOF_FROM_INVLIST	\
 	assert(node); assert(invlist_ptr)
+STATIC void	S_rck_elide_nothing(pTHX_ regnode *node);
+#define PERL_ARGS_ASSERT_RCK_ELIDE_NOTHING	\
+	assert(node)
 PERL_STATIC_NO_RET void	S_re_croak2(pTHX_ bool utf8, const char* pat1, const char* pat2, ...)
 			__attribute__noreturn__;
 #define PERL_ARGS_ASSERT_RE_CROAK2	\
@@ -4920,7 +4923,7 @@ STATIC void	S_ssc_or(pTHX_ const RExC_state_t *pRExC_state, regnode_ssc *ssc, co
 PERL_STATIC_INLINE void	S_ssc_union(pTHX_ regnode_ssc *ssc, SV* const invlist, const bool invert_2nd);
 #define PERL_ARGS_ASSERT_SSC_UNION	\
 	assert(ssc); assert(invlist)
-STATIC SSize_t	S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, SSize_t *minlenp, SSize_t *deltap, regnode *last, struct scan_data_t *data, I32 stopparen, U32 recursed_depth, regnode_ssc *and_withp, U32 flags, U32 depth);
+STATIC SSize_t	S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp, SSize_t *minlenp, SSize_t *deltap, regnode *last, struct scan_data_t *data, I32 stopparen, U32 recursed_depth, regnode_ssc *and_withp, U32 flags, U32 depth, bool was_mutate_ok);
 #define PERL_ARGS_ASSERT_STUDY_CHUNK	\
 	assert(pRExC_state); assert(scanp); assert(minlenp); assert(deltap); assert(last)
 #endif
diff --git a/regcomp.c b/regcomp.c
index ab2c236ec2..28857eab70 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -119,6 +119,7 @@ typedef struct scan_frame {
     U32 prev_recursed_depth;
     I32 stopparen;              /* what stopparen do we use */
     U32 is_top_frame;           /* what flags do we use? */
+    bool in_gosub;              /* this or an outer frame is for GOSUB */
 
     struct scan_frame *this_prev_frame; /* this previous frame */
     struct scan_frame *prev_frame;      /* previous frame */
@@ -4077,7 +4078,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
 			I32 stopparen,
                         U32 recursed_depth,
 			regnode_ssc *and_withp,
-			U32 flags, U32 depth)
+			U32 flags, U32 depth, bool was_mutate_ok)
 			/* scanp: Start here (read-write). */
 			/* deltap: Write maxlen-minlen here. */
 			/* last: Stop before this one. */
@@ -4153,6 +4154,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
                                    node length to get a real minimum (because
                                    the folded version may be shorter) */
 	bool unfolded_multi_char = FALSE;
+        /* avoid mutating ops if we are anywhere within the recursed or
+         * enframed handling for a GOSUB: the outermost level will handle it.
+         */
+        bool mutate_ok = was_mutate_ok && !(frame && frame->in_gosub);
 	/* Peephole optimizer: */
         DEBUG_STUDYDATA("Peep:", data, depth);
         DEBUG_PEEP("Peep", scan, depth);
@@ -4163,30 +4168,13 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
          * parsing code, as each (?:..) is handled by a different invocation of
          * reg() -- Yves
          */
-        JOIN_EXACT(scan,&min_subtract, &unfolded_multi_char, 0);
-
-	/* Follow the next-chain of the current node and optimize
-	   away all the NOTHINGs from it.  */
-	if (OP(scan) != CURLYX) {
-	    const int max = (reg_off_by_arg[OP(scan)]
-		       ? I32_MAX
-		       /* I32 may be smaller than U16 on CRAYs! */
-		       : (I32_MAX < U16_MAX ? I32_MAX : U16_MAX));
-	    int off = (reg_off_by_arg[OP(scan)] ? ARG(scan) : NEXT_OFF(scan));
-	    int noff;
-	    regnode *n = scan;
-
-	    /* Skip NOTHING and LONGJMP. */
-	    while ((n = regnext(n))
-		   && ((PL_regkind[OP(n)] == NOTHING && (noff = NEXT_OFF(n)))
-		       || ((OP(n) == LONGJMP) && (noff = ARG(n))))
-		   && off + noff < max)
-		off += noff;
-	    if (reg_off_by_arg[OP(scan)])
-		ARG(scan) = off;
-	    else
-		NEXT_OFF(scan) = off;
-	}
+        if (mutate_ok)
+            JOIN_EXACT(scan,&min_subtract, &unfolded_multi_char, 0);
+
+        /* Follow the next-chain of the current node and optimize
+           away all the NOTHINGs from it.
+         */
+        rck_elide_nothing(scan);
 
 	/* The principal pseudo-switch.  Cannot be a switch, since we
 	   look into several different things.  */
@@ -4212,7 +4200,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
              * NOTE we dont use the return here! */
             (void)study_chunk(pRExC_state, &scan, &minlen,
                               &deltanext, next, &data_fake, stopparen,
-                              recursed_depth, NULL, f, depth+1);
+                              recursed_depth, NULL, f, depth+1, mutate_ok);
 
             scan = next;
         } else
@@ -4279,7 +4267,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
 		    /* we suppose the run is continuous, last=next...*/
 		    minnext = study_chunk(pRExC_state, &scan, minlenp,
                                       &deltanext, next, &data_fake, stopparen,
-                                      recursed_depth, NULL, f,depth+1);
+                                      recursed_depth, NULL, f, depth+1,
+                                      mutate_ok);
 
 		    if (min1 > minnext)
 			min1 = minnext;
@@ -4346,9 +4335,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
 		    }
 		}
 
-                if (PERL_ENABLE_TRIE_OPTIMISATION &&
-                        OP( startbranch ) == BRANCH )
-                {
+                if (PERL_ENABLE_TRIE_OPTIMISATION
+                    && OP(startbranch) == BRANCH
+                    && mutate_ok
+                ) {
 		/* demq.
 
                    Assuming this was/is a branch we are dealing with: 'scan'
@@ -4799,6 +4789,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
                 newframe->stopparen = stopparen;
                 newframe->prev_recursed_depth = recursed_depth;
                 newframe->this_prev_frame= frame;
+                newframe->in_gosub = (
+                    (frame && frame->in_gosub) || OP(scan) == GOSUB
+                );
 
                 DEBUG_STUDYDATA("frame-new:",data,depth);
                 DEBUG_PEEP("fnew", scan, depth);
@@ -5017,7 +5010,7 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
                                   (mincount == 0
                                    ? (f & ~SCF_DO_SUBSTR)
                                    : f)
-                                  ,depth+1);
+                                  , depth+1, mutate_ok);
 
 		if (flags & SCF_DO_STCLASS)
 		    data->start_class = oclass;
@@ -5065,6 +5058,12 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
 		    (void)ReREFCNT_inc(RExC_rx_sv);
 		}
 
+                if ( ( minnext > 0 && mincount >= SSize_t_MAX / minnext )
+                    || min >= SSize_t_MAX - minnext * mincount )
+                {
+                    FAIL("Regexp out of space");
+                }
+
 		min += minnext * mincount;
 		is_inf_internal |= deltanext == SSize_t_MAX
                          || (maxcount == REG_INFTY && minnext + deltanext > 0);
@@ -5079,7 +5078,9 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
 		if (  OP(oscan) == CURLYX && data
 		      && data->flags & SF_IN_PAR
 		      && !(data->flags & SF_HAS_EVAL)
-		      && !deltanext && minnext == 1 ) {
+		      && !deltanext && minnext == 1
+                      && mutate_ok
+                ) {
 		    /* Try to optimize to CURLYN.  */
 		    regnode *nxt = NEXTOPER(oscan) + EXTRA_STEP_2ARGS;
 		    regnode * const nxt1 = nxt;
@@ -5125,10 +5126,10 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
 		      && !(data->flags & SF_HAS_EVAL)
 		      && !deltanext	/* atom is fixed width */
 		      && minnext != 0	/* CURLYM can't handle zero width */
-
                          /* Nor characters whose fold at run-time may be
                           * multi-character */
                       && ! (RExC_seen & REG_UNFOLDED_MULTI_SEEN)
+                      && mutate_ok
 		) {
 		    /* XXXX How to optimize if data == 0? */
 		    /* Optimize to a simpler form.  */
@@ -5175,7 +5176,8 @@ S_study_chunk(pTHX_ RExC_state_t *pRExC_state, regnode **scanp,
 #endif
 			/* Optimize again: */
 			study_chunk(pRExC_state, &nxt1, minlenp, &deltanext, nxt,
-                                    NULL, stopparen, recursed_depth, NULL, 0,depth+1);
+                                    NULL, stopparen, recursed_depth, NULL, 0,
+                                    depth+1, mutate_ok);
 		    }
 		    else
 			oscan->flags = 0;
@@ -5296,11 +5298,7 @@ Perl_re_printf( aTHX_  "LHS=%"UVuf" RHS=%"UVuf"\n",
 		if (data && (fl & SF_HAS_EVAL))
 		    data->flags |= SF_HAS_EVAL;
 	      optimize_curly_tail:
-		if (OP(oscan) != CURLYX) {
-		    while (PL_regkind[OP(next = regnext(oscan))] == NOTHING
-			   && NEXT_OFF(next))
-			NEXT_OFF(oscan) += NEXT_OFF(next);
-		}
+		rck_elide_nothing(oscan);
 		continue;
 
 	    default:
@@ -5560,7 +5558,8 @@ Perl_re_printf( aTHX_  "LHS=%"UVuf" RHS=%"UVuf"\n",
                 nscan = NEXTOPER(NEXTOPER(scan));
                 minnext = study_chunk(pRExC_state, &nscan, minlenp, &deltanext,
                                       last, &data_fake, stopparen,
-                                      recursed_depth, NULL, f, depth+1);
+                                      recursed_depth, NULL, f, depth+1,
+                                      mutate_ok);
                 if (scan->flags) {
                     if (deltanext) {
 			FAIL("Variable length lookbehind not implemented");
@@ -5649,7 +5648,7 @@ Perl_re_printf( aTHX_  "LHS=%"UVuf" RHS=%"UVuf"\n",
                 *minnextp = study_chunk(pRExC_state, &nscan, minnextp,
                                         &deltanext, last, &data_fake,
                                         stopparen, recursed_depth, NULL,
-                                        f,depth+1);
+                                        f, depth+1, mutate_ok);
                 if (scan->flags) {
                     if (deltanext) {
 			FAIL("Variable length lookbehind not implemented");
@@ -5809,7 +5808,8 @@ Perl_re_printf( aTHX_  "LHS=%"UVuf" RHS=%"UVuf"\n",
                            branches even though they arent otherwise used. */
                         minnext = study_chunk(pRExC_state, &scan, minlenp,
                             &deltanext, (regnode *)nextbranch, &data_fake,
-                            stopparen, recursed_depth, NULL, f,depth+1);
+                            stopparen, recursed_depth, NULL, f, depth+1,
+                            mutate_ok);
                     }
                     if (nextbranch && PL_regkind[OP(nextbranch)]==BRANCH)
                         nextbranch= regnext((regnode*)nextbranch);
@@ -6150,6 +6150,44 @@ S_pat_upgrade_to_utf8(pTHX_ RExC_state_t * const pRExC_state,
     RExC_orig_utf8 = RExC_utf8 = 1;
 }
 
+/* Follow the next-chain of the current node and optimize away
+   all the NOTHINGs from it.
+ */
+STATIC void
+S_rck_elide_nothing(pTHX_ regnode *node)
+{
+    dVAR;
+
+    PERL_ARGS_ASSERT_RCK_ELIDE_NOTHING;
+
+    if (OP(node) != CURLYX) {
+        const int max = (reg_off_by_arg[OP(node)]
+                        ? I32_MAX
+                          /* I32 may be smaller than U16 on CRAYs! */
+                        : (I32_MAX < U16_MAX ? I32_MAX : U16_MAX));
+        int off = (reg_off_by_arg[OP(node)] ? ARG(node) : NEXT_OFF(node));
+        int noff;
+        regnode *n = node;
+
+        /* Skip NOTHING and LONGJMP. */
+        while (
+            (n = regnext(n))
+            && (
+                (PL_regkind[OP(n)] == NOTHING && (noff = NEXT_OFF(n)))
+                || ((OP(n) == LONGJMP) && (noff = ARG(n)))
+            )
+            && off + noff < max
+        ) {
+            off += noff;
+        }
+        if (reg_off_by_arg[OP(node)])
+            ARG(node) = off;
+        else
+            NEXT_OFF(node) = off;
+    }
+    return;
+}
+
 
 
 /* S_concat_pat(): concatenate a list of args to the pattern string pat,
@@ -7458,7 +7496,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
             &data, -1, 0, NULL,
             SCF_DO_SUBSTR | SCF_WHILEM_VISITED_POS | stclass_flag
                           | (restudied ? SCF_TRIE_DOING_RESTUDY : 0),
-            0);
+            0, TRUE);
 
 
         CHECK_RESTUDY_GOTO_butfirst(LEAVE_with_name("study_chunk"));
@@ -7604,7 +7642,7 @@ Perl_re_op_compile(pTHX_ SV ** const patternp, int pat_count,
             SCF_DO_STCLASS_AND|SCF_WHILEM_VISITED_POS|(restudied
                                                       ? SCF_TRIE_DOING_RESTUDY
                                                       : 0),
-            0);
+            0, TRUE);
 
         CHECK_RESTUDY_GOTO_butfirst(NOOP);
 
diff --git a/t/re/pat.t b/t/re/pat.t
index f32e5299f7..225d73e166 100644
--- a/t/re/pat.t
+++ b/t/re/pat.t
@@ -23,7 +23,7 @@ BEGIN {
     skip_all_without_unicode_tables();
 }
 
-plan tests => 790;  # Update this when adding/deleting tests.
+plan tests => 794;  # Update this when adding/deleting tests.
 
 run_tests() unless caller;
 
@@ -1769,6 +1769,30 @@ EOP
         ok(scalar($text !~ m{(~*=[a-z]=)}g), "RT #131575");
     }
 
+    # gh16947: test regexp corruption (GOSUB)
+    {
+        fresh_perl_is(q{
+            'xy' =~ /x(?0)|x(?|y|y)/ && print 'ok'
+        }, 'ok', {}, 'gh16947: test regexp corruption (GOSUB)');
+    }
+    # gh16947: test fix doesn't break SUSPEND
+    {
+        fresh_perl_is(q{ 'sx' =~ m{ss++}i; print 'ok' },
+                'ok', {}, "gh16947: test fix doesn't break SUSPEND");
+    }
+
+    # gh17743: more regexp corruption via GOSUB
+    {
+        fresh_perl_is(q{
+            "0" =~ /((0(?0)|000(?|0000|0000)(?0))|)/; print "ok"
+        }, 'ok', {}, 'gh17743: test regexp corruption (1)');
+
+        fresh_perl_is(q{
+            "000000000000" =~ /(0(())(0((?0)())|000(?|\x{ef}\x{bf}\x{bd}|\x{ef}\x{bf}\x{bd}))|)/;
+            print "ok"
+        }, 'ok', {}, 'gh17743: test regexp corruption (2)');
+    }
+
 } # End of sub run_tests
 
 1;

Reply to: