--- curl-7.12.1/lib/http_ntlm.c.CAN-2005-3185 2005-10-14 13:05:29.000000000 +0200 +++ curl-7.12.1/lib/http_ntlm.c 2005-10-14 13:05:29.000000000 +0200 @@ -529,6 +529,13 @@ CURLcode Curl_output_ntlm(struct connect 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;