a_dbus_convert_value(): Be less strict about wrong strings

The code doesn't check the type of any of the values that it converts. However,
string elements are silently skipped if they cannot be converted.

The proper fix would be to make this code check types. For now, it will be ok to
"convert" non-strings to an empty string.

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-01-15 20:08:34 +01:00
parent 8b3087dc4e
commit 82f74aa895
1 changed files with 3 additions and 2 deletions

3
dbus.c
View File

@ -319,7 +319,8 @@ a_dbus_convert_value(lua_State *L, int idx, DBusMessageIter *iter)
case dbustype: \
{ \
const char *s = lua_tostring(L, idx + 1); \
if(s) \
if(!s) \
s = ""; \
dbus_message_iter_append_basic(iter, dbustype, &s); \
} \
break;