Skip to content

Commit

Permalink
Guard against too many key-value pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
jarun committed Mar 1, 2020
1 parent db129c9 commit 5533e38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nnn.c
Original file line number Diff line number Diff line change
Expand Up @@ -2915,7 +2915,7 @@ static bool parsekvpair(kv **arr, char **envcpy, const uchar id, ushort *items)
++nextkey;
}

if (!maxitems)
if (!maxitems || maxitems > 100)
return FALSE;

*arr = calloc(maxitems, sizeof(kv));
Expand Down

0 comments on commit 5533e38

Please sign in to comment.