From: Seonah Moon Date: Fri, 10 Feb 2017 08:48:30 +0000 (+0900) Subject: WGID-149077: Fixed integer overflow issue X-Git-Tag: accepted/tizen/common/20170214.173413^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F90%2F114190%2F1;p=platform%2Fupstream%2Fconnman.git WGID-149077: Fixed integer overflow issue Change-Id: Ie2d0939e43080aa2c7937f912d13ece6c39fdb9c Signed-off-by: Seonah Moon --- diff --git a/src/dnsproxy.c b/src/dnsproxy.c index 58ce442..d44de64 100755 --- a/src/dnsproxy.c +++ b/src/dnsproxy.c @@ -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; }