]> git.ipfire.org Git - thirdparty/systemd.git/commit
sd-json: fix sd_json_variant_unsigned() dispatching to wrong accessor for references 41529/head
authorChristian Brauner <brauner@kernel.org>
Wed, 1 Apr 2026 21:23:18 +0000 (23:23 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 6 Apr 2026 20:02:54 +0000 (22:02 +0200)
commit5b5423efa37d0c865c99ac02a22821f39ffdd2e1
treef169f31db81937ce8b5dcfc8ca50f973ac68ba7f
parent26a9ed955975c8a278d0cfbda410b7cd00b9d4bc
sd-json: fix sd_json_variant_unsigned() dispatching to wrong accessor for references

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>
src/libsystemd/sd-json/sd-json.c