Fix off-by-one in iteration.

This commit is contained in:
Giovanni Bajo authored and Simon Kelley committed 2013-08-20 15:41:18 +01:00
1 parent 382e38f494
commit 6445c8ed73
1 file changed
+1 -1
+1 -1
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 == '.')