DBUS_TYPE_BOOLEAN is 'int', which does not have to be the same size as
'bool'.
On architecture where bool is smaller than in, getting prepare-authorize
will corrupt the stack
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
} else if (strcasecmp(key, "prepare-authorize") == 0) {
if (var != DBUS_TYPE_BOOLEAN)
return -EINVAL;
- if (prep_authorize)
- dbus_message_iter_get_basic(&value,
- prep_authorize);
+ if (prep_authorize) {
+ int tmp;
+
+ dbus_message_iter_get_basic(&value, &tmp);
+ *prep_authorize = !!tmp;
+ }
}
dbus_message_iter_next(&dict);