aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ldap.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2005-08-06 03:43:42 +0000
committerGerald Combs <gerald@wireshark.org>2005-08-06 03:43:42 +0000
commitb992c7339116ada28b7021349a6dbea9f023ded0 (patch)
treed34048dd20602ebb2a1ccafb954bec0bfe7c2e4a /epan/dissectors/packet-ldap.c
parent312c524a4cb9cfc7884ed2b06aa8806a686d10a7 (diff)
In packet-frame.c, don't free static memory when we throw a
DissectorError. In packet-kerberos.c, restore pinfo->private_data if we throw an exception, which keeps the SMB dissector from throwing a DissectorError. Initialize variables in other places to squelch valgrind warnings. svn path=/trunk/; revision=15235
Diffstat (limited to 'epan/dissectors/packet-ldap.c')
-rw-r--r--epan/dissectors/packet-ldap.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/epan/dissectors/packet-ldap.c b/epan/dissectors/packet-ldap.c
index 95b0739ab0..1800225700 100644
--- a/epan/dissectors/packet-ldap.c
+++ b/epan/dissectors/packet-ldap.c
@@ -353,7 +353,7 @@ static int read_sequence(ASN1_SCK *a, guint *len)
{
guint cls, con, tag;
gboolean def;
- guint length;
+ guint length = 0;
int ret;
ret = asn1_header_decode(a, &cls, &con, &tag, &def, &length);
@@ -588,8 +588,9 @@ static int read_bytestring_value(ASN1_SCK *a, proto_tree *tree, int hf_id,
else
string = "(null)";
- if (tree)
+ if (tree && length > 0) {
temp_item = proto_tree_add_bytes(tree, hf_id, a->tvb, start, a->offset - start, string);
+}
if (new_item)
*new_item = temp_item;
@@ -2338,10 +2339,10 @@ dissect_ldap_payload(tvbuff_t *tvb, packet_info *pinfo,
guint length_remaining;
ASN1_SCK a;
int ret;
- guint msg_len;
- int messageOffset;
- guint headerLength;
- guint length;
+ guint msg_len = 0;
+ int messageOffset = 0;
+ guint headerLength = 0;
+ guint length = 0;
tvbuff_t *msg_tvb = NULL;
proto_item *msg_item = NULL;
proto_tree *msg_tree = NULL;