diff --git a/libc/netdb/lib_gethostbynamer.c b/libc/netdb/lib_gethostbynamer.c index 9e1a924bdf..96fcf9312c 100644 --- a/libc/netdb/lib_gethostbynamer.c +++ b/libc/netdb/lib_gethostbynamer.c @@ -196,7 +196,9 @@ static int lib_numeric_address(FAR const char *name, FAR struct hostent *host, ptr += addrlen; buflen -= addrlen; - /* And copy name */ + /* And copy name + * REVISIT: Should the check not be (namelen + 1 > buflen)? + */ namelen = strlen(name); if (addrlen + namelen + 1 > buflen) @@ -284,7 +286,9 @@ static int lib_localhost(FAR const char *name, FAR struct hostent *host, dest += addrlen; buflen -= addrlen; - /* And copy name */ + /* And copy name + * REVISIT: Should the check not be (namelen + 1 > buflen)? + */ namelen = strlen(name); if (addrlen + namelen + 1 > buflen) @@ -400,7 +404,9 @@ static int lib_find_answer(FAR const char *name, FAR struct hostent *host, ptr += addrlen; buflen -= addrlen; - /* And copy the host name */ + /* And copy name + * REVISIT: Should the check not be (namelen + 1 > buflen)? + */ namelen = strlen(name); if (addrlen + namelen + 1 > buflen) @@ -546,7 +552,9 @@ static int lib_dns_lookup(FAR const char *name, FAR struct hostent *host, ptr += addrlen; buflen -= addrlen; - /* And copy the name */ + /* And copy name + * REVISIT: Should the check not be (namelen + 1 > buflen)? + */ namelen = strlen(name); if (addrlen + namelen + 1 > buflen)