From b5900e53d9eaf5defebf06cb2ed439e5cdeed110 Mon Sep 17 00:00:00 2001 From: Evan Huus Date: Sun, 25 Aug 2013 17:31:15 +0000 Subject: Make sure our ldap_call_response_t struct is always completely initialized, fixing a "Conditional jump or move depends on uninitialised value" error found by valgrind fuzzing. svn path=/trunk/; revision=51516 --- asn1/ldap/packet-ldap-template.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'asn1/ldap') diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c index a602a97540..684eb617d2 100644 --- a/asn1/ldap/packet-ldap-template.c +++ b/asn1/ldap/packet-ldap-template.c @@ -781,6 +781,8 @@ ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu lcr.req_frame=0; lcr.rep_frame=pinfo->fd->num; break; + default: + return NULL; } lcrp=(ldap_call_response_t *)g_hash_table_lookup(ldap_info->matched, &lcr); @@ -814,7 +816,7 @@ ldap_match_call_response(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gu } /* if we cant reuse the old one, grab a new chunk */ if(!lcrp){ - lcrp=se_new(ldap_call_response_t); + lcrp=se_new0(ldap_call_response_t); } lcrp->messageId=messageId; lcrp->req_frame=pinfo->fd->num; -- cgit v1.2.3