--- curl-7.11.2/lib/http_ntlm.c 2005-10-14 11:04:25.017979923 +0100 +++ curl-7.11.2/lib/http_ntlm.c 2005-10-14 11:07:29.271188618 +0100 @@ -531,6 +531,13 @@ 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;