Author: abartlet Date: 2006-09-04 01:59:23 +0000 (Mon, 04 Sep 2006) New Revision: 18024
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18024 Log: The %c sscanf format I'm using doesn't null terminate. Andrew Bartlett Modified: branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c Changeset: Modified: branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c =================================================================== --- branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c 2006-09-04 00:32:46 UTC (rev 18023) +++ branches/SAMBA_4_0/source/libcli/ldap/ldap_client.c 2006-09-04 01:59:23 UTC (rev 18024) @@ -311,9 +311,12 @@ 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);