View | Details | Raw Unified | Return to bug 252385
Collapse All | Expand All

(-)source4/libcli/ldap/ldap_client.c (-3 / +2 lines)
Lines 336-342 Link Here
336
	uint16_t *pport)	/* Not set for ldapi */
336
	uint16_t *pport)	/* Not set for ldapi */
337
{
337
{
338
	enum ldap_proto proto = LDAP_PROTO_NONE;
338
	enum ldap_proto proto = LDAP_PROTO_NONE;
339
	char *host = NULL;
339
	char host[1025];
340
	int ret, port;
340
	int ret, port;
341
341
342
	if (url == NULL) {
342
	if (url == NULL) {
Lines 403-415 Link Here
403
		return 0;
403
		return 0;
404
	}
404
	}
405
405
406
	ret = sscanf(url, "%m[^:/]:%d", &host, &port);
406
	ret = sscanf(url, "%254[^:/]:%d", host, &port);
407
	if (ret < 1) {
407
	if (ret < 1) {
408
		return EINVAL;
408
		return EINVAL;
409
	}
409
	}
410
410
411
	*pdest = talloc_strdup(mem_ctx, host);
411
	*pdest = talloc_strdup(mem_ctx, host);
412
	SAFE_FREE(host);
413
	if (*pdest == NULL) {
412
	if (*pdest == NULL) {
414
		return ENOMEM;
413
		return ENOMEM;
415
	}
414
	}

Return to bug 252385