From e2bb0d0ba75265101cefd7325d705a7bf63ec585 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 18 Jun 2005 13:15:09 +0000 Subject: r7725: fixed a bug with partial asn1 frames in the ldap client (This used to be commit 0f22306a9c61c1b00aeb0f3bf7e875d9b7b4606d) --- source4/libcli/ldap/ldap_client.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source4/libcli/ldap') diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c index f2b09e89e3..41764b9a37 100644 --- a/source4/libcli/ldap/ldap_client.c +++ b/source4/libcli/ldap/ldap_client.c @@ -156,6 +156,8 @@ static void ldap_try_decode_plain(struct ldap_connection *conn) /* try and decode - this will fail if we don't have a full packet yet */ while (asn1.ofs < asn1.length) { struct ldap_message *msg = talloc(conn, struct ldap_message); + off_t saved_ofs = asn1.ofs; + if (msg == NULL) { ldap_connection_dead(conn); return; @@ -164,6 +166,7 @@ static void ldap_try_decode_plain(struct ldap_connection *conn) if (ldap_decode(&asn1, msg)) { ldap_match_message(conn, msg); } else { + asn1.ofs = saved_ofs; talloc_free(msg); break; } -- cgit