diff --git a/src/libsystemd/sd-json/sd-json.c b/src/libsystemd/sd-json/sd-json.c index 182a85ae7f..77f7524d2a 100644 --- a/src/libsystemd/sd-json/sd-json.c +++ b/src/libsystemd/sd-json/sd-json.c @@ -5096,6 +5096,10 @@ _public_ int sd_json_dispatch_full( int r, done = 0; bool *found; + /* Consider a NULL pointer equivalent to an empty object */ + if (!v) + v = JSON_VARIANT_MAGIC_EMPTY_OBJECT; + if (!sd_json_variant_is_object(v)) { json_log(v, flags, 0, "JSON variant is not an object.");