You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2008/02/12 19:59:53 UTC

[Bug 5823] warn: Use of uninitialized value in pattern match (m//) at Rule2XSBody.pm line 244.

http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5823





------- Additional Comments From msergeant@startechgroup.co.uk  2008-02-12 10:59 -------
(In reply to comment #0)
> Line 244 in Rule2XSBody.pm refers to a variable $flags that has bee set and then
> used with
> 
>   $rulename =~ s/,\[(.*?)\]$//;
>   my $flags = $1;
>   [ ... ]
>   if ($flags =~ /\bl=0/) {
> 
> Perl experts -- Is it the case that the above leaves $flags undefined if
> $rulename does not end in ',[something]' and if so is the correct fix to make
> the second line

No. If the regexp doesn't match then $flags gets set to $1 from the previous
successful match. Which is obviously bad.

You need to check the regexp actually matched.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.