Fix off-by-one in iteration.

This commit is contained in:
Giovanni Bajo
2012-04-24 02:02:29 +02:00
committed by Simon Kelley
parent 382e38f494
commit 6445c8ed73

View File

@@ -58,7 +58,7 @@ static int extract_name_no_compression(unsigned char *rr, int maxlen, char *buf)
while (rr < end && *rr != 0)
{
count = *rr++;
while (count-- >= 0 && rr < end)
while (count-- > 0 && rr < end)
{
*buf = *rr++;
if (!isascii(*buf) || iscntrl(*buf) || *buf == '.')