You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by Karsten Bräckelmann <gu...@rudersport.de> on 2010/06/01 22:38:02 UTC

Re: trivial fix to: Use of uninitialized value $opt{"syslog-socket"} in lc

On Tue, 2010-06-01 at 15:21 -0500, Todd Rinaldo wrote:
> > -my $log_socket = lc($opt{'syslog-socket'});
> > +my $log_socket = $opt{'syslog-socket'};
> > 
> >  if (!defined $log_socket || $log_socket eq '') {
> >    $log_socket = am_running_on_windows() ? 'none' : 'unix';
> > +} else {
> > +  $log_socket = lc $log_socket;
> >  }

> This will actually cause warnings under perl 5.12, since perl 5.12 now
> warns you that undef was passed to lc.

That's exactly what the patch prevents, moving the lc() in the else
block that only gets evaluated if $log_socket is defined and not an
empty string.


> It'll still return an empty string but may cause allot of warnings.
> These warnings have just been  cleaned out of the 3.3 branch, so I
> hate to see one go back in. I  would suggest ...
> 
> $log_socket = $log_socket || '';
> 
> instead of
> 
> $log_socket = lc $log_socket;
> 
> It's more explicit about what you're trying to do anyway. In fact, not
> knowing the code, 0 might be a better choice than an empty string?

-- 
char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1:
(c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}