From: Junghoon Park Date: Mon, 13 Jun 2016 01:36:43 +0000 (+0900) Subject: Fix bug about receiving packets in case of 0 size payload X-Git-Tag: accepted/tizen/common/20160614.143645^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71dcb2753d8dc428f0f4c731474fd1cad5fc459a;p=platform%2Fcore%2Fappfw%2Faul-1.git Fix bug about receiving packets in case of 0 size payload Change-Id: I6b69d8c81a8eaaf137b072bc2c6b8804523eb173 Signed-off-by: Junghoon Park --- diff --git a/src/aul_sock.c b/src/aul_sock.c index 91a87a0..390bd70 100644 --- a/src/aul_sock.c +++ b/src/aul_sock.c @@ -430,7 +430,7 @@ API app_pkt_t *aul_sock_recv_pkt(int fd, int *clifd, struct ucred *cr) 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; } @@ -493,7 +493,7 @@ retry_recv: 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;