]> Sergey Matveev's repositories - nnn.git/commitdiff
Guard against too many key-value pairs
authorArun Prakash Jana <engineerarun@gmail.com>
Sun, 1 Mar 2020 13:29:27 +0000 (18:59 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sun, 1 Mar 2020 13:29:27 +0000 (18:59 +0530)
src/nnn.c

index b31418cf5e62d024b20de50412d8429c90f6bb98..fdc4c3aa9cc7669cb095df0d652b2d43ce1987d4 100644 (file)
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -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));