aboutsummaryrefslogtreecommitdiffstats
path: root/asn1
diff options
context:
space:
mode:
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2011-04-21 19:51:05 +0000
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>2011-04-21 19:51:05 +0000
commit5b5c81db1896a95d4879cb48f955374cf68deb6e (patch)
treec572a9614f7934d70de564ffa22e179180de0d6a /asn1
parente740788b6741cb50a4c785b679eb21857a56bc68 (diff)
From Stefan Metzmacher and Gregor Beck via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5850 :
The smallest LDAP PDU is 7 bytes, not 4. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36777 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'asn1')
-rw-r--r--asn1/ldap/packet-ldap-template.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/asn1/ldap/packet-ldap-template.c b/asn1/ldap/packet-ldap-template.c
index 74dffda805..681eda11ab 100644
--- a/asn1/ldap/packet-ldap-template.c
+++ b/asn1/ldap/packet-ldap-template.c
@@ -1705,7 +1705,36 @@ this_was_not_sasl:
goto this_was_not_normal_ldap;
}
- tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 4, get_normal_ldap_pdu_len, dissect_normal_ldap_pdu);
+ /*
+ * The minimun size of a LDAP pdu is 7 bytes
+ *
+ * dumpasn1 -hh ldap-unbind-min.dat
+ *
+ * <30 05 02 01 09 42 00>
+ * 0 5: SEQUENCE {
+ * <02 01 09>
+ * 2 1: INTEGER 9
+ * <42 00>
+ * 5 0: [APPLICATION 2]
+ * : Error: Object has zero length.
+ * : }
+ *
+ * dumpasn1 -hh ldap-unbind-windows.dat
+ *
+ * <30 84 00 00 00 05 02 01 09 42 00>
+ * 0 5: SEQUENCE {
+ * <02 01 09>
+ * 6 1: INTEGER 9
+ * <42 00>
+ * 9 0: [APPLICATION 2]
+ * : Error: Object has zero length.
+ * : }
+ *
+ * 6 bytes would also be ok to get the full length of
+ * the pdu, but as the smallest pdu can be 7 bytes
+ * we can use 7.
+ */
+ tcp_dissect_pdus(tvb, pinfo, tree, ldap_desegment, 7, get_normal_ldap_pdu_len, dissect_normal_ldap_pdu);
goto end;