mirror of
https://github.com/skywind3000/kcp.git
synced 2024-12-26 23:20:10 +08:00
fixed the crash issue when len is minus caused by invalid data.
This commit is contained in:
parent
b8100f9de9
commit
3580539e0f
2
ikcp.c
2
ikcp.c
@ -772,7 +772,7 @@ int ikcp_input(ikcpcb *kcp, const char *data, long size)
|
||||
|
||||
size -= IKCP_OVERHEAD;
|
||||
|
||||
if ((long)size < (long)len) return -2;
|
||||
if ((long)size < (long)len || (int)len < 0) return -2;
|
||||
|
||||
if (cmd != IKCP_CMD_PUSH && cmd != IKCP_CMD_ACK &&
|
||||
cmd != IKCP_CMD_WASK && cmd != IKCP_CMD_WINS)
|
||||
|
Loading…
Reference in New Issue
Block a user