sd_json_variant_unsigned() incorrectly calls sd_json_variant_integer()
for reference-type variants instead of recursing to itself. This silently
returns 0 for unsigned values in the range INT64_MAX+1 through
UINT64_MAX, since sd_json_variant_integer() cannot represent them.
The sibling functions sd_json_variant_integer() and
sd_json_variant_real() correctly recurse to themselves.
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
if (!json_variant_is_regular(v))
goto mismatch;
if (v->is_reference)
- return sd_json_variant_integer(v->reference);
+ return sd_json_variant_unsigned(v->reference);
switch (v->type) {