James Bursa's fix to prevent failf() to write outside its buffer boundary

This commit is contained in:
Daniel Stenberg 2003-10-27 06:35:47 +00:00
parent 54c6f2c7c0
commit 203f66d0cb

View File

@ -154,7 +154,7 @@ void Curl_failf(struct SessionHandle *data, const char *fmt, ...)
if(data->set.verbose) {
int len = strlen(data->set.errorbuffer);
bool doneit=FALSE;
if(len < CURL_ERROR_SIZE) {
if(len < CURL_ERROR_SIZE - 1) {
doneit = TRUE;
data->set.errorbuffer[len] = '\n';
data->set.errorbuffer[++len] = '\0';