Fix bug about receiving packets in case of 0 size payload 07/74107/1 accepted/tizen/common/20160614.143645 accepted/tizen/ivi/20160614.041203 accepted/tizen/mobile/20160614.041109 accepted/tizen/tv/20160614.041148 accepted/tizen/wearable/20160614.041131 submit/tizen/20160613.023047 submit/tizen/20160613.062107
authorJunghoon Park <jh9216.park@samsung.com>
Mon, 13 Jun 2016 01:36:43 +0000 (10:36 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Mon, 13 Jun 2016 01:36:43 +0000 (10:36 +0900)
Change-Id: I6b69d8c81a8eaaf137b072bc2c6b8804523eb173
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
src/aul_sock.c

index 91a87a0..390bd70 100644 (file)
@@ -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;