Closed afpd closed 5 years ago
_port
is of type signed int. If this were negative and very large, it could overflow char[10]
by one byte. It would be better to use something like this::
sprintf(cport, "%hu", (unsigned short)_port);
You can then reduce cport down to size 6 = sizeof("65536") + 1.
Also, can you change the instances of fprintf(stderr, [...]); / exit(EXIT_FAILURE);
to use error.Die
and include useful information for debugging purposes (e.g. _host and cport)?
Patch to rawhoisc.cc makes rawhois class multiple A and AAAA records aware. Changes also fix a case when
peval
utility used on IPv6-only hosts.