]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libcli/ldap: Fix decoding struct ldap_ExtendedResponse
authorVolker Lendecke <vl@samba.org>
Tue, 23 Jun 2020 17:09:28 +0000 (19:09 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 9 Jul 2020 20:16:40 +0000 (20:16 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
libcli/ldap/ldap_message.c
selftest/knownfail.d/ldap-exop [deleted file]

index 69a482795326661fe4bd4dc6214094f1db122cca..c7d868449630a0e7da6748ef9064a3d2701b9df2 100644 (file)
@@ -1540,7 +1540,8 @@ _PUBLIC_ NTSTATUS ldap_decode(struct asn1_data *data,
                if (!ldap_decode_response(msg, data, &r->response)) goto prot_err;
 
                if (asn1_peek_tag(data, ASN1_CONTEXT_SIMPLE(10))) {
-                       if (!asn1_read_ContextSimple(data, msg, 1, &tmp_blob)) goto prot_err;
+                       if (!asn1_read_ContextSimple(data, msg, 10, &tmp_blob))
+                               goto prot_err;
                        r->oid = blob2string_talloc(msg, tmp_blob);
                        data_blob_free(&tmp_blob);
                        if (!r->oid) {
@@ -1551,7 +1552,8 @@ _PUBLIC_ NTSTATUS ldap_decode(struct asn1_data *data,
                }
 
                if (asn1_peek_tag(data, ASN1_CONTEXT_SIMPLE(11))) {
-                       if (!asn1_read_ContextSimple(data, msg, 1, &tmp_blob)) goto prot_err;
+                       if (!asn1_read_ContextSimple(data, msg, 11, &tmp_blob))
+                               goto prot_err;
                        r->value = talloc(msg, DATA_BLOB);
                        if (!r->value) {
                                return NT_STATUS_LDAP(LDAP_OPERATIONS_ERROR);
diff --git a/selftest/knownfail.d/ldap-exop b/selftest/knownfail.d/ldap-exop
deleted file mode 100644 (file)
index ee41af0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-libcli.ldap.ldap_message.test_decode_exop_response\(none\)