diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-09-04 01:59:23 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:17:04 -0500 |
commit | e21e8379a2ce9f3ca70227889c5c11a719516980 (patch) | |
tree | 89663d6999e0f3a69de37c07336fb951220a9a0e /source4/libcli | |
parent | 36ca11b00a1432654819d9fca75be56ab827e3ca (diff) | |
download | samba-e21e8379a2ce9f3ca70227889c5c11a719516980.tar.gz samba-e21e8379a2ce9f3ca70227889c5c11a719516980.tar.bz2 samba-e21e8379a2ce9f3ca70227889c5c11a719516980.zip |
r18024: The %c sscanf format I'm using doesn't null terminate.
Andrew Bartlett
(This used to be commit 1920cb8b3978f745cba7e854410deb9174de2dc0)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/ldap/ldap_client.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c index 4fa8cc0146..bc230879fc 100644 --- a/source4/libcli/ldap/ldap_client.c +++ b/source4/libcli/ldap/ldap_client.c @@ -311,9 +311,12 @@ struct composite_context *ldap_connect_send(struct ldap_connection *conn, if (!NT_STATUS_IS_OK(status)) { return NULL; } + talloc_steal(conn, conn->sock); SMB_ASSERT(sizeof(protocol)>10); SMB_ASSERT(sizeof(path)>1024); + /* The %c specifier doesn't null terminate :-( */ + ZERO_STRUCT(path); ret = sscanf(url, "%10[^:]://%1025c", protocol, path); if (ret < 2) { composite_error(state->ctx, NT_STATUS_INVALID_PARAMETER); |