libs/libnx: handle the bad message correctly
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
7933442b98
commit
4824ea68a9
@ -146,7 +146,11 @@ int nx_eventhandler(NXHANDLE handle)
|
|||||||
}
|
}
|
||||||
while (nbytes < 0);
|
while (nbytes < 0);
|
||||||
|
|
||||||
DEBUGASSERT(nbytes >= sizeof(struct nxclimsg_s));
|
if (nbytes < sizeof(struct nxclimsg_s))
|
||||||
|
{
|
||||||
|
_NX_SETERRNO(EBADMSG);
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
/* Dispatch the message appropriately */
|
/* Dispatch the message appropriately */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user