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 | 1920cb8b3978f745cba7e854410deb9174de2dc0 (patch) | |
tree | 12b989ceee14a02ccf2418379668828168b236dd /source/libcli | |
parent | 999d989131f41d0218ec05595c9761aff5bbf5fa (diff) | |
download | samba-1920cb8b3978f745cba7e854410deb9174de2dc0.tar.gz |
r18024: The %c sscanf format I'm using doesn't null terminate.
Andrew Bartlett
Diffstat (limited to 'source/libcli')
-rw-r--r-- | source/libcli/ldap/ldap_client.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/libcli/ldap/ldap_client.c b/source/libcli/ldap/ldap_client.c index 4fa8cc01464..bc230879fc9 100644 --- a/source/libcli/ldap/ldap_client.c +++ b/source/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); |