Re: scripts/postfix 1.35 BUG

Tom Metro <[email protected]>
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <[email protected]>
Marius Isken wrote:
> There's a bug in the current postfix script, regex like email
> adresses  in the logfile are crashing the script.
> 
> ...to=<[email protected]>
> 
> Insert in sub cleanhostreply($ $ $ $)
> Line 2158
> 
> $recip =~ s/([\S])/\\$0/g;

Is that so this RE:

       $r1 =~ s/[<(]?$recip[>)]?\W*//ig;

works as expected? If so, there's a better way to do that.

       $r1 =~ s/[<(]?\Q$recip\E[>)]?\W*//ig;

\Q and \E or quotemeta() should always be used to escape strings used in 
REs that aren't intended to be treated as REs.

  -Tom

-- 
Tom Metro
Venture Logic, Newton, MA, USA
"Enterprise solutions through open source."
Professional Profile: http://tmetro.venturelogic.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.