perl-test-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tors...@apache.org
Subject svn commit: r1486414 - in /perl/Apache-Test/tags/1_37: Changes lib/Apache/TestSSLCA.pm
Date Sun, 26 May 2013 14:32:06 GMT
Author: torsten
Date: Sun May 26 14:32:05 2013
New Revision: 1486414

URL: http://svn.apache.org/r1486414
Log:
Fix a while(each %hash) loop that modifies the hash it iterates over.
This has been documented to lead to undefined behavior for a long time
and with perl 5.18 it generates a warning which we turn into fatal.

Modified:
    perl/Apache-Test/tags/1_37/Changes
    perl/Apache-Test/tags/1_37/lib/Apache/TestSSLCA.pm

Modified: perl/Apache-Test/tags/1_37/Changes
URL: http://svn.apache.org/viewvc/perl/Apache-Test/tags/1_37/Changes?rev=1486414&r1=1486413&r2=1486414&view=diff
==============================================================================
--- perl/Apache-Test/tags/1_37/Changes (original)
+++ perl/Apache-Test/tags/1_37/Changes Sun May 26 14:32:05 2013
@@ -6,6 +6,11 @@ Changes - Apache::Test change logfile
 
 =over 3
 
+=item dev
+
+Fix an occurrence of hash modification inside a while(each %hash) loop
+[Torsten]
+
 =item 1.37 January 29, 2012
 
 Apache::TestRequest: improve compatibility for SSL requests with LWP 6 and

Modified: perl/Apache-Test/tags/1_37/lib/Apache/TestSSLCA.pm
URL: http://svn.apache.org/viewvc/perl/Apache-Test/tags/1_37/lib/Apache/TestSSLCA.pm?rev=1486414&r1=1486413&r2=1486414&view=diff
==============================================================================
--- perl/Apache-Test/tags/1_37/lib/Apache/TestSSLCA.pm (original)
+++ perl/Apache-Test/tags/1_37/lib/Apache/TestSSLCA.pm Sun May 26 14:32:05 2013
@@ -100,10 +100,10 @@ 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 $name = join '_', $key, 'dsa';
-    $cert_dn->{$name} = { %$val }; #copy
+    $cert_dn->{$name} = { %{$cert_dn->{$key}} }; #copy
     $cert_dn->{$name}->{OU} =~ s/rsa/dsa/;
 }
 



Mime
View raw message