spamassassin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmarti...@apache.org
Subject svn commit: r610063 - /spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DCC.pm
Date Tue, 08 Jan 2008 16:42:12 GMT
Author: mmartinec
Date: Tue Jan  8 08:42:11 2008
New Revision: 610063

URL: http://svn.apache.org/viewvc?rev=610063&view=rev
Log:
DCC: avoid warnings on "uninitialized value in split" when dcc_options are empty

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DCC.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DCC.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DCC.pm?rev=610063&r1=610062&r2=610063&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DCC.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/DCC.pm Tue Jan  8 08:42:11 2008
@@ -414,7 +414,8 @@
   my $right;
   my $timeout = $self->{main}->{conf}->{dcc_timeout};
   my $sockpath = $self->{main}->{conf}->{dcc_dccifd_path};
-  my @opts = split(' ',$self->{main}->{conf}->{dcc_options});
+  my $opts = $self->{main}->{conf}->{dcc_options};
+  my @opts = !defined $opts ? () : split(' ',$opts);
 
   $count{body} = 0;
   $count{fuz1} = 0;
@@ -538,7 +539,8 @@
     # note: not really tainted, this came from system configuration file
     my $path = Mail::SpamAssassin::Util::untaint_file_path($self->{main}->{conf}->{dcc_path});
 
-    my @opts = split(' ',$self->{main}->{conf}->{dcc_options}||'');
+    my $opts = $self->{main}->{conf}->{dcc_options};
+    my @opts = !defined $opts ? () : split(' ',$opts);
     untaint_var(\@opts);
 
     unshift(@opts, "-a",
@@ -693,7 +695,8 @@
   my $timeout = $self->{main}->{conf}->{dcc_timeout};
   my $sockpath = $self->{main}->{conf}->{dcc_dccifd_path};
   # instead of header use whatever the report option is
-  my @opts = split(' ',$self->{main}->{conf}->{dcc_options});
+  my $opts = $self->{main}->{conf}->{dcc_options};
+  my @opts = !defined $opts ? () : split(' ',$opts);
 
   $options->{report}->enter_helper_run_mode();
   my $timer = Mail::SpamAssassin::Timeout->new({ secs => $timeout });
@@ -749,7 +752,8 @@
 
   # note: not really tainted, this came from system configuration file
   my $path = Mail::SpamAssassin::Util::untaint_file_path($options->{report}->{conf}->{dcc_path});
-  my @opts = split(' ',$self->{main}->{conf}->{dcc_options});
+  my $opts = $self->{main}->{conf}->{dcc_options};
+  my @opts = !defined $opts ? () : split(' ',$opts);
   untaint_var(\@opts);
 
   # get the metadata from the message so we can pass the external relay info



Mime
View raw message