#947054 Crush with invalid? response

#947054#5
Date:
2019-12-20 04:49:27 UTC
From:
To:
jdresolve will be crushed to resolve the IP address 146.155.4.14.

$echo 146.155.4.14 > /tmp/t
$jdresolve /tmp/t
Use of uninitialized value $type in string eq at /usr/bin/jdresolve line 786, <FILE> line 1.
Use of uninitialized value $query in exists at /usr/bin/jdresolve line 790, <FILE> line 1.
Use of uninitialized value $query in concatenation (.) or string at /usr/bin/jdresolve line 790, <FILE> line 1.
no such class:  at /usr/bin/jdresolve line 790, <FILE> line 1.

#947054#10
Date:
2021-12-21 19:07:36 UTC
From:
To:
I've only seen this bug 2 or 3 times in the last year, but here is the
fix I used to avoid the warning.
--- /usr/bin/jdresolve  2018-01-04 18:21:09.000000000 +0000 +++ jdresolve   2021-11-14 00:28:17.725549514 +0000 @@ -783,6 +783,8 @@         my $type = $socks{fileno($socket)}{TYPE};         my $query = $socks{fileno($socket)}{QUERY}; +       !(defined $type) and return 0; +         if ($type eq 'H') {                 !exists $hosts{$query} and die "no such host: $query";                 undef $hosts{$query}{SOCKET};