From 0bb1488d315e93162eae433f869c1ddabea722c0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 23 Jun 2020 19:09:28 +0200 Subject: [PATCH] libcli/ldap: Fix decoding struct ldap_ExtendedResponse Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- libcli/ldap/ldap_message.c | 6 ++++-- selftest/knownfail.d/ldap-exop | 1 - 2 files changed, 4 insertions(+), 3 deletions(-) delete mode 100644 selftest/knownfail.d/ldap-exop diff --git a/libcli/ldap/ldap_message.c b/libcli/ldap/ldap_message.c index 69a48279532..c7d86844963 100644 --- a/libcli/ldap/ldap_message.c +++ b/libcli/ldap/ldap_message.c @@ -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 index ee41af082c7..00000000000 --- a/selftest/knownfail.d/ldap-exop +++ /dev/null @@ -1 +0,0 @@ -libcli.ldap.ldap_message.test_decode_exop_response\(none\)