Skip to content

Commit ebade23

Browse files
committed
transports: auth_ntlm: fix use of strdup/strndup
In the NTLM authentication code, we accidentally use strdup(3P) and strndup(3P) instead of our own wrappers git__strdup and git__strndup, respectively. Fix the issue by using our own functions.
1 parent 3828ea6 commit ebade23

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/transports/auth_ntlm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ static int ntlm_set_credentials(http_auth_ntlm_context *ctx, git_credential *_cr
5050
cred = (git_credential_userpass_plaintext *)_cred;
5151

5252
if ((sep = strchr(cred->username, '\\')) != NULL) {
53-
domain = strndup(cred->username, (sep - cred->username));
53+
domain = git__strndup(cred->username, (sep - cred->username));
5454
GIT_ERROR_CHECK_ALLOC(domain);
5555

56-
domainuser = strdup(sep + 1);
56+
domainuser = git__strdup(sep + 1);
5757
GIT_ERROR_CHECK_ALLOC(domainuser);
5858

5959
username = domainuser;

0 commit comments

Comments
 (0)