commit | a621c533af8baabf55f7a84e72f76fe2bad23edd | [log] [tgz] |
---|---|---|
author | Michal Vasko <mvasko@cesnet.cz> | Mon Feb 14 08:49:51 2022 +0100 |
committer | Michal Vasko <mvasko@cesnet.cz> | Tue Mar 15 11:36:42 2022 +0100 |
tree | 01ba6a33db07668ca461823bcc7c23ed4da75c95 | |
parent | de2b10f46d0fe2528de0ba1af4c72e3adc609654 [diff] [blame] |
parser json BUGFIX handle invalid JSON in nested ext parsing
diff --git a/src/parser_json.c b/src/parser_json.c index 49fd941..c9fc573 100644 --- a/src/parser_json.c +++ b/src/parser_json.c
@@ -214,6 +214,10 @@ if ((in_start.current[0] == '\"') && (in_start.current[-1] != '\\')) { ++quot_count; } + if (in_start.current == in_start.start) { + /* invalid JSON */ + return LY_ENOT; + } } while (quot_count < 2); /* check if there are any nested extension instances */