Fix validation creteria

This commit is contained in:
Marc André Tanner 2015-02-17 00:34:44 +01:00
parent bd3dcba548
commit f02c3fc3c0
1 changed files with 1 additions and 1 deletions

View File

@ -182,7 +182,7 @@ static bool recv_packet(int socket, Packet *pkt) {
ssize_t len = read_all(socket, (char*)pkt, packet_header_size());
if (len <= 0 || len != packet_header_size())
return false;
if (len > sizeof(pkt->u.msg))
if (pkt->len > sizeof(pkt->u.msg))
return false;
if (pkt->len > 0) {
len = read_all(socket, pkt->u.msg, pkt->len);