summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-06-15 22:41:56 +0200
committerSven Eden <yamakuzure@gmx.net>2017-06-16 10:13:01 +0200
commit1443d4b2e7210724b40411b108b1e2d30063ca5d (patch)
tree8b9453cbf30d9271790e12ce294b5746c14ce26f /src/shared
parentb14e279c9d24f926007ffacf12a261b6dc30f4d0 (diff)
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.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/bus-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 12b091ceb..ebfe2255f 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -1052,7 +1052,7 @@ static int map_basic(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_
case SD_BUS_TYPE_BOOLEAN: {
unsigned b;
- bool *p = userdata;
+ int *p = userdata;
r = sd_bus_message_read_basic(m, type, &b);
if (r < 0)