summaryrefslogtreecommitdiff
path: root/source4/libcli/ldap
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-18 13:15:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:26 -0500
commite2bb0d0ba75265101cefd7325d705a7bf63ec585 (patch)
tree2bb54d33fce834ada23f056cc982bc5e4ded37c6 /source4/libcli/ldap
parentbe19641f30f9a13a38dd08216e1fd22aaaffa9bd (diff)
downloadsamba-e2bb0d0ba75265101cefd7325d705a7bf63ec585.tar.gz
samba-e2bb0d0ba75265101cefd7325d705a7bf63ec585.tar.bz2
samba-e2bb0d0ba75265101cefd7325d705a7bf63ec585.zip
r7725: fixed a bug with partial asn1 frames in the ldap client
(This used to be commit 0f22306a9c61c1b00aeb0f3bf7e875d9b7b4606d)
Diffstat (limited to 'source4/libcli/ldap')
-rw-r--r--source4/libcli/ldap/ldap_client.c3
1 files changed, 3 insertions, 0 deletions
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;
}