summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPeter Maydell2020-11-17 22:06:58 +0100
committerPeter Maydell2020-11-17 22:06:58 +0100
commit84dae210506784945ec8342a613d7bd62ae6ec62 (patch)
tree0f85638c786f7f11ff9cd1305ea3ade9b76e6544 /tests
parentMerge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20201117'... (diff)
parentjson: Fix a memleak in parse_pair() (diff)
downloadqemu-84dae210506784945ec8342a613d7bd62ae6ec62.tar.gz
qemu-84dae210506784945ec8342a613d7bd62ae6ec62.tar.xz
qemu-84dae210506784945ec8342a613d7bd62ae6ec62.zip
Merge remote-tracking branch 'remotes/armbru/tags/pull-qobject-2020-11-17' into staging
QObject patches patches for 2020-11-17 # gpg: Signature made Tue 17 Nov 2020 14:41:06 GMT # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qobject-2020-11-17: json: Fix a memleak in parse_pair() Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'tests')
-rw-r--r--tests/check-qjson.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/check-qjson.c b/tests/check-qjson.c
index 07a773e653..9a02079099 100644
--- a/tests/check-qjson.c
+++ b/tests/check-qjson.c
@@ -1415,6 +1415,14 @@ static void invalid_dict_comma(void)
g_assert(obj == NULL);
}
+static void invalid_dict_key(void)
+{
+ Error *err = NULL;
+ QObject *obj = qobject_from_json("{32:'abc'}", &err);
+ error_free_or_abort(&err);
+ g_assert(obj == NULL);
+}
+
static void unterminated_literal(void)
{
Error *err = NULL;
@@ -1500,6 +1508,7 @@ int main(int argc, char **argv)
g_test_add_func("/errors/unterminated/dict_comma", unterminated_dict_comma);
g_test_add_func("/errors/invalid_array_comma", invalid_array_comma);
g_test_add_func("/errors/invalid_dict_comma", invalid_dict_comma);
+ g_test_add_func("/errors/invalid_dict_key", invalid_dict_key);
g_test_add_func("/errors/unterminated/literal", unterminated_literal);
g_test_add_func("/errors/limits/nesting", limits_nesting);
g_test_add_func("/errors/multiple_values", multiple_values);