Initialize inlen to 0 in lib_dnscache.c
authorjunmin kim <junmindd.kim@samsung.com>
Wed, 27 Sep 2017 08:25:12 +0000 (01:25 -0700)
committerjunmin kim <junmindd.kim@samsung.com>
Wed, 27 Sep 2017 08:25:12 +0000 (01:25 -0700)
Uninitialized data is read from local variable 'inlen' at lib_dnscache.c:295.
The variable is uninitialized at lib_dnscache.c:295.

lib/libc/netdb/lib_dnscache.c

index a636b12..63bf2b5 100644 (file)
@@ -267,7 +267,7 @@ int dns_find_answer(FAR const char *hostname, FAR struct sockaddr *addr, FAR soc
                         */
 
                        if (strncmp(hostname, entry->name, CONFIG_NETDB_DNSCLIENT_NAMESIZE) == 0) {
-                               socklen_t inlen;
+                               socklen_t inlen = 0;
 
                                /* We have a match.  Return the resolved host address */