Fix svace issue (WGID: 35595). 87/235287/2 accepted/tizen/unified/20200609.153555 submit/tizen/20200608.074554
authorNiraj Kumar Goit <niraj.g@samsung.com>
Wed, 3 Jun 2020 10:02:48 +0000 (15:32 +0530)
committerNiraj Kumar Goit <niraj.g@samsung.com>
Thu, 4 Jun 2020 10:29:29 +0000 (15:59 +0530)
Change-Id: Ic15e0f9b8cc44d9641abf8d07242e890576fa2aa
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
src/dns64.c
src_ext/specific_dns.c

index 8fbd81c..ce8043e 100644 (file)
@@ -59,6 +59,12 @@ int plat_prefix(const char *ipv4_name, unsigned net_id, struct in6_addr *prefix)
                status = specific_getaddrinfo(ipv4_name, &hints, &result);
        else
                status = getaddrinfo(ipv4_name, NULL, &hints, &result);
+
+       if (status != 0) {
+               CLATD_LOG(LOG_ERROR, "plat_prefix/dns(%s) status = %d/%s", ipv4_name, status,
+                               gai_strerror(status));
+               return 0;
+       }
 #else
        // Be sure to query local DNS64 servers, bypassing Private DNS (if enabled).
        if (net_id != NETID_UNSET) {
@@ -66,12 +72,13 @@ int plat_prefix(const char *ipv4_name, unsigned net_id, struct in6_addr *prefix)
        }
 
        status = android_getaddrinfofornet(ipv4_name, NULL, &hints, net_id, MARK_UNSET, &result);
-#endif
+
        if (status != 0 || result == NULL) {
                CLATD_LOG(LOG_ERROR, "plat_prefix/dns(%s) status = %d/%s", ipv4_name, status,
                                gai_strerror(status));
                return 0;
        }
+#endif
 
        // Use only the first result.  If other records are present, possibly with
        // differing DNS64 prefixes they are ignored (there is very little sensible
index 88febb0..d0596f7 100644 (file)
@@ -364,6 +364,10 @@ int specific_getaddrinfo(const char *hostname,
                        host_result = NULL;
                }
        }
+#if defined TIZEN_EXT
+       if (!addrinfo_result)
+               return -1;
+#endif
        *result = addrinfo_result;
 
        CLATD_LOG(LOG_INFO, "done");