memcpy(&datalen, buf + sizeof(int), sizeof(int));
memcpy(&opt, buf + sizeof(int) + sizeof(int), sizeof(int));
- if (datalen <= 0 || datalen > MAX_PAYLOAD_SIZE) {
+ if (datalen < 0 || datalen > MAX_PAYLOAD_SIZE) {
close(*clifd);
return NULL;
}
memcpy(&len, buf + sizeof(int), sizeof(int));
memcpy(&recv_opt, buf + sizeof(int) + sizeof(int), sizeof(int));
- if (len <= 0 || len > MAX_PAYLOAD_SIZE) {
+ if (len < 0 || len > MAX_PAYLOAD_SIZE) {
close(fd);
*ret_pkt = NULL;
return -ECOMM;