aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/ldap
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2006-07-12 18:12:15 +0000
committerGerald Combs <gerald@wireshark.org>2006-07-12 18:12:15 +0000
commitd4819d469061d7d5eb994a73c3379efe5af97f2a (patch)
tree6d5fbf033a1ccc874bdc813b86024e4f026c1e2d /asn1/ldap
parentace05a68306dfa7e354188d5ef50ddf287aa5d77 (diff)
downloadwireshark-d4819d469061d7d5eb994a73c3379efe5af97f2a.tar.gz
wireshark-d4819d469061d7d5eb994a73c3379efe5af97f2a.tar.bz2
wireshark-d4819d469061d7d5eb994a73c3379efe5af97f2a.zip
Make sure our strings aren't null before we pass them to strncmp().
svn path=/trunk/; revision=18723
Diffstat (limited to 'asn1/ldap')
-rw-r--r--asn1/ldap/packet-ldap-template.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c
index fe2e0c3670..a5f262a59b 100644
--- a/asn1/ldap/packet-ldap-template.c
+++ b/asn1/ldap/packet-ldap-template.c
@@ -289,7 +289,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, pa
* Add more special cases as required to prettify further
* (there cant be that many ones that are truly interesting)
*/
- if(!strncmp("DomainSid", attributedesc_string, 9)){
+ if(attributedesc_string && !strncmp("DomainSid", attributedesc_string, 9)){
tvbuff_t *sid_tvb;
char *tmpstr;
@@ -300,11 +300,11 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, pa
g_free(tmpstr);
goto finished;
- } else if ( (len==16) /* GUIDs are always 16 bytes */
- && (!strncmp("DomainGuid", attributedesc_string, 10))) {
+ } else if ( (len==16) /* GUIDs are always 16 bytes */
+ && (attributedesc_string && !strncmp("DomainGuid", attributedesc_string, 10))) {
guint8 drep[4] = { 0x10, 0x00, 0x00, 0x00}; /* fake DREP struct */
e_uuid_t uuid;
-
+
/* This octet string contained a GUID */
dissect_dcerpc_uuid_t(tvb, offset, pinfo, tree, drep, hf_ldap_guid, &uuid);
@@ -328,7 +328,7 @@ dissect_ldap_AssertionValue(gboolean implicit_tag, tvbuff_t *tvb, int offset, pa
* for LDAP, and using that to determine how to display
* attribute values and assertion values?
*
- * -- I dont think there are full schemas available that describe the
+ * -- I dont think there are full schemas available that describe the
* interesting cases i.e. AD -- ronnie
*/
str=tvb_get_ptr(tvb, offset, len);