1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

Make sure that the user and domain strings fit in the target buffer before we

copy them there.
This commit is contained in:
Daniel Stenberg 2005-10-13 07:57:51 +00:00
parent b433e4a1e7
commit 943aea6267

View File

@ -713,6 +713,13 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
size=64; size=64;
ntlmbuf[62]=ntlmbuf[63]=0; ntlmbuf[62]=ntlmbuf[63]=0;
/* Make sure that the user and domain strings fit in the target buffer
before we copy them there. */
if(size + userlen + domlen >= sizeof(ntlmbuf)) {
failf(conn->data, "user + domain name too big");
return CURLE_OUT_OF_MEMORY;
}
memcpy(&ntlmbuf[size], domain, domlen); memcpy(&ntlmbuf[size], domain, domlen);
size += domlen; size += domlen;