summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2014-09-22 13:28:18 -0700
committerJeremy Allison <jra@samba.org>2014-09-26 00:51:16 +0200
commitb1a1f691c8d1b6b1064a5033c81451e5c606b9f4 (patch)
treea7652e2b37cc60a6cce6799d74742876d632be6e
parentac54f519cbb332b5d8aab06c3fa61780d8f3ee0f (diff)
downloadsamba-b1a1f691c8d1b6b1064a5033c81451e5c606b9f4.tar.gz
samba-b1a1f691c8d1b6b1064a5033c81451e5c606b9f4.tar.xz
samba-b1a1f691c8d1b6b1064a5033c81451e5c606b9f4.zip
s4: libcli: ldap controls - Ensure all asn1_XX returns are checked.
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
-rw-r--r--source4/libcli/ldap/ldap_controls.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/source4/libcli/ldap/ldap_controls.c b/source4/libcli/ldap/ldap_controls.c
index 17d96f6f9d..1e67a0124a 100644
--- a/source4/libcli/ldap/ldap_controls.c
+++ b/source4/libcli/ldap/ldap_controls.c
@@ -1129,10 +1129,16 @@ static bool encode_openldap_dereference(void *mem_ctx, void *in, DATA_BLOB *out)
}
}
- asn1_pop_tag(data);
- asn1_pop_tag(data);
+ if (!asn1_pop_tag(data)) {
+ return false;
+ }
+ if (!asn1_pop_tag(data)) {
+ return false;
+ }
+ }
+ if (!asn1_pop_tag(data)) {
+ return false;
}
- asn1_pop_tag(data);
*out = data_blob_talloc(mem_ctx, data->data, data->length);
if (out->data == NULL) {
@@ -1181,8 +1187,12 @@ static bool decode_openldap_dereference(void *mem_ctx, DATA_BLOB in, void *_out)
return false;
}
- asn1_read_OctetString_talloc(r[i], data, &r[i]->source_attribute);
- asn1_read_OctetString_talloc(r[i], data, &r[i]->dereferenced_dn);
+ if (!asn1_read_OctetString_talloc(r[i], data, &r[i]->source_attribute)) {
+ return false;
+ }
+ if (!asn1_read_OctetString_talloc(r[i], data, &r[i]->dereferenced_dn)) {
+ return false;
+ }
if (asn1_peek_tag(data, ASN1_CONTEXT(0))) {
if (!asn1_start_tag(data, ASN1_CONTEXT(0))) {
return false;