Guard against too many key-value pairs

This commit is contained in:
Arun Prakash Jana 2020-03-01 18:59:27 +05:30
parent db129c9120
commit 5533e38fbb
No known key found for this signature in database
GPG key ID: A75979F35C080412

View file

@ -2915,7 +2915,7 @@ static bool parsekvpair(kv **arr, char **envcpy, const uchar id, ushort *items)
++nextkey; ++nextkey;
} }
if (!maxitems) if (!maxitems || maxitems > 100)
return FALSE; return FALSE;
*arr = calloc(maxitems, sizeof(kv)); *arr = calloc(maxitems, sizeof(kv));