summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2020-02-24 21:49:43 +0100
committerPatrick Steinhardt <ps@pks.im>2020-02-24 21:49:43 +0100
commitebade23333d1f5c460aeb7f02473c96c95568a91 (patch)
treef5b06dd404fca7e858340b51515d6fcfe1caae09
parent3828ea67b97fc56dead976f319792ead3aa7e623 (diff)
downloadlibgit2-ebade23333d1f5c460aeb7f02473c96c95568a91.tar.gz
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.
-rw-r--r--src/transports/auth_ntlm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/transports/auth_ntlm.c b/src/transports/auth_ntlm.c
index 02a861f07..d134a3db6 100644
--- a/src/transports/auth_ntlm.c
+++ b/src/transports/auth_ntlm.c
@@ -50,10 +50,10 @@ static int ntlm_set_credentials(http_auth_ntlm_context *ctx, git_credential *_cr
cred = (git_credential_userpass_plaintext *)_cred;
if ((sep = strchr(cred->username, '\\')) != NULL) {
- domain = strndup(cred->username, (sep - cred->username));
+ domain = git__strndup(cred->username, (sep - cred->username));
GIT_ERROR_CHECK_ALLOC(domain);
- domainuser = strdup(sep + 1);
+ domainuser = git__strdup(sep + 1);
GIT_ERROR_CHECK_ALLOC(domainuser);
username = domainuser;