chiark / gitweb /
sd-bus: make sure bus_map_all_properties() handle booleans right
authorLennart Poettering <lennart@poettering.net>
Wed, 15 Jun 2016 20:41:56 +0000 (22:41 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 16 Jun 2017 08:13:01 +0000 (10:13 +0200)
commit1443d4b2e7210724b40411b108b1e2d30063ca5d
tree8b9453cbf30d9271790e12ce294b5746c14ce26f
parentb14e279c9d24f926007ffacf12a261b6dc30f4d0
sd-bus: make sure bus_map_all_properties() handle booleans right

sd-bus generally exposes bools as "int" instead of "bool" in the public API.
This is relevant when unmarshaling booleans, as the relevant functions expect
an int* pointer and no bool* pointer. Since sizeof(bool) is not necessarily the
same as sizeof(int) this is problematic and might result in memory corruption.

Let's fix this, and make sure bus_map_all_properties() handles booleans as
ints, as the rest of sd-bus, and make all users of it expect the right thing.
src/login/loginctl.c
src/shared/bus-util.c