Commit 6445c8ed authored by Giovanni Bajo's avatar Giovanni Bajo Committed by Simon Kelley

Fix off-by-one in iteration.

parent 382e38f4
...@@ -58,7 +58,7 @@ static int extract_name_no_compression(unsigned char *rr, int maxlen, char *buf) ...@@ -58,7 +58,7 @@ static int extract_name_no_compression(unsigned char *rr, int maxlen, char *buf)
while (rr < end && *rr != 0) while (rr < end && *rr != 0)
{ {
count = *rr++; count = *rr++;
while (count-- >= 0 && rr < end) while (count-- > 0 && rr < end)
{ {
*buf = *rr++; *buf = *rr++;
if (!isascii(*buf) || iscntrl(*buf) || *buf == '.') if (!isascii(*buf) || iscntrl(*buf) || *buf == '.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment