wdns_reverse_name: fix buffer overflow with corrupt input