summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-10-04 10:35:32 +0200
committerStefan Metzmacher <metze@samba.org>2010-10-04 14:05:15 +0000
commit42d1a84a360ed56c123bb7bab6340d9e8425a8c0 (patch)
tree16083a97829e3994b24c98fba9caa55f24db4f3f
parent4423aa59abda50c8b71815f922ea03e2009f9e50 (diff)
downloadsamba-42d1a84a360ed56c123bb7bab6340d9e8425a8c0.tar.gz
samba-42d1a84a360ed56c123bb7bab6340d9e8425a8c0.tar.bz2
samba-42d1a84a360ed56c123bb7bab6340d9e8425a8c0.zip
libcli/ldap: ldap_full_packet() requires at least 6 bytes
metze
-rw-r--r--libcli/ldap/ldap_message.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcli/ldap/ldap_message.c b/libcli/ldap/ldap_message.c
index e5b94b8df1..b9f9dff223 100644
--- a/libcli/ldap/ldap_message.c
+++ b/libcli/ldap/ldap_message.c
@@ -1611,5 +1611,12 @@ _PUBLIC_ NTSTATUS ldap_decode(struct asn1_data *data,
*/
NTSTATUS ldap_full_packet(void *private_data, DATA_BLOB blob, size_t *packet_size)
{
+ if (blob.length < 6) {
+ /*
+ * We need at least 6 bytes to workout the length
+ * of the pdu.
+ */
+ return STATUS_MORE_ENTRIES;
+ }
return asn1_peek_full_tag(blob, ASN1_SEQUENCE(0), packet_size);
}