Skip to content

Commit

Permalink
Make sure that the user and domain strings fit in the target buffer b…
Browse files Browse the repository at this point in the history
…efore we

copy them there.
  • Loading branch information
bagder committed Oct 13, 2005
1 parent b433e4a commit 943aea6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/http_ntlm.c
Expand Up @@ -713,6 +713,13 @@ CURLcode Curl_output_ntlm(struct connectdata *conn,
size=64;
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);
size += domlen;

Expand Down

0 comments on commit 943aea6

Please sign in to comment.