As the jsmn library doesn't differentiate between tokens that are keys and tokens that are values, if there's a value "env" in an arbitrary key, the parsing code in init.c will get confused and think that's the key containing the array of environment variables.
By ensuring the next token is a JSMN_ARRAY we can minimize the risk of this occurrence. If this still proves to be a problem, we might find the need to switch to a more complete JSON parsing library.
As the jsmn library doesn't differentiate between tokens that are keys and tokens that are values, if there's a value "env" in an arbitrary key, the parsing code in init.c will get confused and think that's the key containing the array of environment variables.
By ensuring the next token is a JSMN_ARRAY we can minimize the risk of this occurrence. If this still proves to be a problem, we might find the need to switch to a more complete JSON parsing library.
Fixes: #104 Signed-off-by: Sergio Lopez slp@redhat.com