From: Lennart Poettering Date: Fri, 4 Jan 2019 12:24:18 +0000 (+0100) Subject: json: handle NULL explicitly in json_variant_has_type() X-Git-Tag: archive/raspbian/240-5+rpi1^2~44 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=1bce69c788a59fc73ea90b34c480314751af1af9;p=systemd.git json: handle NULL explicitly in json_variant_has_type() (cherry picked from commit f8c186c9ece5c1c0b89abf52f058efb0ed37e0cb) (cherry picked from commit 388e534d24cac041bd00b48f27a84d6b31089c67) Gbp-Pq: Name json-handle-NULL-explicitly-in-json_variant_has_type.patch --- diff --git a/src/shared/json.c b/src/shared/json.c index 59c46175..c9ee74c2 100644 --- a/src/shared/json.c +++ b/src/shared/json.c @@ -979,6 +979,8 @@ bool json_variant_has_type(JsonVariant *v, JsonVariantType type) { JsonVariantType rt; v = json_variant_dereference(v); + if (!v) + return false; rt = json_variant_type(v); if (rt == type)