fix potential buffer overflow when txt records are forged