Subject: | libapreq2 make test fails due to "Use of each() on hash after insertion" in Apache/TestSSLCA.pm |
[ error] configure() has failed:
Use of each() on hash after insertion without resetting hash iterator results in undefined behavior, Perl interpreter: 0xce3010 at /home/tim/trunk/cpan/cpan-5.018/lib/perl5/x86_64-linux-thread-multi/Apache/TestSSLCA.pm line 103.
Compilation failed in require at /home/tim/trunk/cpan/cpan-5.018/lib/perl5/x86_64-linux-thread-multi/Apache/TestConfig.pm line 1474.
This patch fixes it:
--- a/cpan-5.018/lib/perl5/x86_64-linux-thread-multi/Apache/TestSSLCA.pm
+++ b/cpan-5.018/lib/perl5/x86_64-linux-thread-multi/Apache/TestSSLCA.pm
@@ -100,8 +100,9 @@ my $cert_dn = {
};
#generate DSA versions of the server certs/keys
-while (my($key, $val) = each %$cert_dn) {
+for my $key (keys %$cert_dn) {
next unless $key =~ /^server/;
+ my $val = $cert_dn->{$key};
my $name = join '_', $key, 'dsa';
$cert_dn->{$name} = { %$val }; #copy
$cert_dn->{$name}->{OU} =~ s/rsa/dsa/;