wdns_reverse_name: fixed buffer overflow on invalid input