curl: only accept COLUMNS less than 10000

... as larger values would rather indicate something silly (and could
potentially cause buffer problems).

Reported-by: pendrek at hackerone
Closes #4114
This commit is contained in:
Daniel Stenberg 2019-07-15 23:52:43 +02:00
parent 275b74a53d
commit 952998cbdb
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 2 additions and 1 deletions

View File

@ -210,7 +210,8 @@ void progressbarinit(struct ProgressData *bar,
if(colp) {
char *endptr;
long num = strtol(colp, &endptr, 10);
if((endptr != colp) && (endptr == colp + strlen(colp)) && (num > 20))
if((endptr != colp) && (endptr == colp + strlen(colp)) && (num > 20) &&
(num < 10000))
bar->width = (int)num;
curl_free(colp);
}