WGID-149077: Fixed integer overflow issue 65/114365/1 accepted/tizen/3.0/common/20170215.120945 accepted/tizen/3.0/ivi/20170215.065108 accepted/tizen/3.0/mobile/20170215.065005 accepted/tizen/3.0/tv/20170215.065028 accepted/tizen/3.0/wearable/20170215.065052 submit/tizen_3.0/20170213.102726
authorSeonah Moon <seonah1.moon@samsung.com>
Fri, 10 Feb 2017 08:48:30 +0000 (17:48 +0900)
committertaesub kim <taesub.kim@samsung.com>
Mon, 13 Feb 2017 06:16:33 +0000 (15:16 +0900)
Change-Id: Ie2d0939e43080aa2c7937f912d13ece6c39fdb9c
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
src/dnsproxy.c

index 58ce442..d44de64 100755 (executable)
@@ -3841,6 +3841,7 @@ static GIOChannel *get_listener(int family, int protocol, int index)
        int option;
        int sd_num = 0;
        int rv;
+       int is_socket_inet = 0;
 #endif
 
        DBG("family %d protocol %d index %d", family, protocol, index);
@@ -3876,11 +3877,12 @@ static GIOChannel *get_listener(int family, int protocol, int index)
                rv = sd_is_socket_inet(sk, family, type, -1, 53);
                if(rv > 0){
                        DBG("socket fd (%d) is passed by systemd", sk);
+                       is_socket_inet = 1;
                        break;
                }
        }
 
-       if(sk >= SD_LISTEN_FDS_START+sd_num){
+       if (!is_socket_inet) {
                DBG("socket fd is not matched what connman requests");
                return NULL;
        }