Skip Menu |

This queue is for tickets about the X11-Protocol CPAN distribution.

Report information
The Basics
Id: 3925
Status: resolved
Priority: 0/
Queue: X11-Protocol

People
Owner: Nobody in particular
Requestors: edels [...] acsys.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.03
Fixed in: 0.52



Subject: Unitialized string in X11::Auth
In X11::Auth, method get_by_host, line 97: my($addr); $addr = gethostbyname($host) if $fam eq "Internet"; #print "host $host, addr $addr\n"; my($d); for $d ($self->get_all) { next unless $dpy eq $d->[2]; next unless $fam eq $d->[0] or ($fam eq "Internet" and $d->[0] eq "Local"); if ($fam eq "Internet" or $fam eq "Local") { Show quoted text
>>>>> if ($d->[1] eq $addr or $d->[1] eq $host) {
return ($d->[3], $d->[4]); } } } The problem is that $addr will not be initialized if $fam is NOT "Internet", causing a "Use of uninitialized value in string eq" error to be printed. I fixed this by changing line 97 to: if ((defined $addr && $d->[1] eq $addr) or $d->[1] eq $host) { but perhaps $addr should be given a default value instead? -David Edelstein
The corresponding line in version 0.52 says: if ($addr && $d->[1] eq $addr or $d->[1] eq $host) { which I think should fix the problem. Thinking about it briefly, I didn't think of any default value that made sense.