diff options
author | Volker Lendecke <vl@samba.org> | 2015-12-21 10:41:39 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2016-01-06 00:54:17 +0100 |
commit | ad630a681e345cc7765f2a2f2dc1ba25ee0200c2 (patch) | |
tree | f629d3ab41d474bbbce9979228e98214d1692b25 /libcli/ldap | |
parent | 45800223fd5fb8d35770d101882cfb2b19465944 (diff) | |
download | samba-ad630a681e345cc7765f2a2f2dc1ba25ee0200c2.tar.gz |
asn1: Make asn1_peek_full_tag return 0/errno
We don't need the full power of NTSTATUS here. This was the only
NTSTATUS in asn1.h, so I think it's worth removing it.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libcli/ldap')
-rw-r--r-- | libcli/ldap/ldap_message.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libcli/ldap/ldap_message.c b/libcli/ldap/ldap_message.c index bf836271de9..491f96053cb 100644 --- a/libcli/ldap/ldap_message.c +++ b/libcli/ldap/ldap_message.c @@ -1635,6 +1635,8 @@ _PUBLIC_ NTSTATUS ldap_decode(struct asn1_data *data, */ NTSTATUS ldap_full_packet(void *private_data, DATA_BLOB blob, size_t *packet_size) { + int ret; + if (blob.length < 6) { /* * We need at least 6 bytes to workout the length @@ -1642,5 +1644,10 @@ NTSTATUS ldap_full_packet(void *private_data, DATA_BLOB blob, size_t *packet_siz */ return STATUS_MORE_ENTRIES; } - return asn1_peek_full_tag(blob, ASN1_SEQUENCE(0), packet_size); + + ret = asn1_peek_full_tag(blob, ASN1_SEQUENCE(0), packet_size); + if (ret != 0) { + return map_nt_error_from_unix_common(ret); + } + return NT_STATUS_OK; } |