From 54f0da368f35ce7d7fd4b093b865ffea284d826b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 22 Sep 2010 14:10:03 +0200 Subject: s3: Use asprintf where appropriate --- source3/pam_smbpass/support.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'source3/pam_smbpass/support.c') diff --git a/source3/pam_smbpass/support.c b/source3/pam_smbpass/support.c index 4215c72991..79f92a8758 100644 --- a/source3/pam_smbpass/support.c +++ b/source3/pam_smbpass/support.c @@ -379,13 +379,10 @@ int _smb_verify_password( pam_handle_t * pamh, struct samu *sampass, } } - data_name = SMB_MALLOC_ARRAY(char, sizeof(FAIL_PREFIX) + strlen( name )); - if (data_name == NULL) { + if (asprintf(&data_name, "-SMB-FAIL- %s", name) == -1) { _log_err(pamh, LOG_CRIT, "no memory for data-name" ); return PAM_AUTH_ERR; } - strncpy( data_name, FAIL_PREFIX, sizeof(FAIL_PREFIX) ); - strncpy( data_name + sizeof(FAIL_PREFIX) - 1, name, strlen( name ) + 1 ); /* * The password we were given wasn't an encrypted password, or it -- cgit