You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by gb...@apache.org on 2020/07/29 14:11:29 UTC

svn commit: r1880406 - /spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm

Author: gbechis
Date: Wed Jul 29 14:11:29 2020
New Revision: 1880406

URL: http://svn.apache.org/viewvc?rev=1880406&view=rev
Log:
hash keys are never tainted,
although old version of perl had some quirks there
skip the check only for Perl > 5.020 to be on the safe side

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm?rev=1880406&r1=1880405&r2=1880406&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Util.pm Wed Jul 29 14:11:29 2020
@@ -344,10 +344,13 @@ sub untaint_var {
           ${$arg}{untaint_var($k)} = untaint_var($v);
         }
       } else {
-        # hash keys are never tainted,
-        # although old version of perl had some quirks there
-        while (my($k, $v) = each %{$arg}) {
-          ${$arg}{untaint_var($k)} = untaint_var($v);
+        if($] < 5.020) {
+          # hash keys are never tainted,
+          # although old version of perl had some quirks there
+          # skip the check only for Perl > 5.020 to be on the safe side
+          while (my($k, $v) = each %{$arg}) {
+            ${$arg}{untaint_var($k)} = untaint_var($v);
+          }
         }
       }
       return %{$arg} if wantarray;