libs/netdb: add sanity check to avoid null pointer reference
Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
parent
6f2f62f4ce
commit
fa63da22ae
@ -736,8 +736,11 @@ int gethostentbyname_r(FAR const char *name,
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
else if ((flags & AI_NUMERICHOST) != 0)
|
else if ((flags & AI_NUMERICHOST) != 0)
|
||||||
|
{
|
||||||
|
if (h_errnop)
|
||||||
{
|
{
|
||||||
*h_errnop = EAI_NONAME;
|
*h_errnop = EAI_NONAME;
|
||||||
|
}
|
||||||
|
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user