mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
libs/netdb: add sanity check to avoid null pointer reference
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
@@ -737,7 +737,10 @@ int gethostentbyname_r(FAR const char *name,
|
|||||||
}
|
}
|
||||||
else if ((flags & AI_NUMERICHOST) != 0)
|
else if ((flags & AI_NUMERICHOST) != 0)
|
||||||
{
|
{
|
||||||
*h_errnop = EAI_NONAME;
|
if (h_errnop)
|
||||||
|
{
|
||||||
|
*h_errnop = EAI_NONAME;
|
||||||
|
}
|
||||||
|
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user