Use wmem_new0 to ensure that all field values are initialized. Caught by
authoreapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 23 Jan 2014 01:48:13 +0000 (01:48 +0000)
committereapache <eapache@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 23 Jan 2014 01:48:13 +0000 (01:48 +0000)
valgrind fuzzing.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@54922 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-sip.c

index 510e9266482c804b2757aa30d50ad084aa7362e9..7255367e3f23ff3aad0302f1c2978a6c7434746b 100644 (file)
@@ -3701,7 +3701,7 @@ guint sip_is_packet_resend(packet_info *pinfo,
 
                /* Allocate a new key and value */
                p_key = wmem_new(wmem_file_scope(), sip_hash_key);
-               p_val = wmem_new(wmem_file_scope(), sip_hash_value);
+               p_val = wmem_new0(wmem_file_scope(), sip_hash_value);
 
                /* Fill in key and value details */
                g_snprintf(p_key->call_id, MAX_CALL_ID_SIZE, "%s", call_id);
@@ -3717,7 +3717,6 @@ guint sip_is_packet_resend(packet_info *pinfo,
                p_val->cseq = cseq_number;
                g_strlcpy(p_val->method, cseq_method, MAX_CSEQ_METHOD_SIZE);
                p_val->transaction_state = nothing_seen;
-               p_val->frame_number = 0;
                if (line_type == REQUEST_LINE)
                {
                        p_val->request_time = pinfo->fd->abs_ts;