Make sure we zero out the newly allocated list, otherwise g_list append may
authorJoerg Mayer <jmayer@loplof.de>
Wed, 22 Feb 2017 00:25:53 +0000 (01:25 +0100)
committerJörg Mayer <jmayer@loplof.de>
Wed, 22 Feb 2017 00:33:13 +0000 (00:33 +0000)
dereference ->next containing an arbitrary value.

Bug: 13418
Change-Id: I240bc03e652ede557083379cc81b81ae83d720e5
Reviewed-on: https://code.wireshark.org/review/20235
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
caputils/capture-pcap-util.c

index b8b71e3bb5c5346755f5f39c9f599ebee0ddd909..3de46f3a75c3ecebc4d07ac7ba09ed1a1b8fb3e0 100644 (file)
@@ -1250,7 +1250,7 @@ get_if_capabilities(interface_options *interface_opts, char **err_str)
         /*
          * Allocate the interface capabilities structure.
          */
-        caps = (if_capabilities_t *)g_malloc(sizeof *caps);
+        caps = (if_capabilities_t *)g_malloc0(sizeof *caps);
 
         auth.type = interface_opts->auth_type == CAPTURE_AUTH_PWD ?
             RPCAP_RMTAUTH_PWD : RPCAP_RMTAUTH_NULL;