Sending an empty byte array to Ethumbd through the D-Bus API was

leading to a segfault.

Patch by: João Paulo Rechi Vita <jprvita@profusion.mobi>



SVN revision: 43159
This commit is contained in:
João Paulo Rechi Vita 2009-10-19 14:04:43 +00:00 committed by Rafael Antognolli
parent 9a0797198d
commit 2b93b55313
1 changed files with 2 additions and 2 deletions

View File

@ -905,10 +905,10 @@ _ethumb_dbus_get_bytearray(DBusMessageIter *iter)
dbus_message_iter_recurse(iter, &riter);
dbus_message_iter_get_fixed_array(&riter, &result, &length);
if (result[0] == '\0')
if ((length == 0) || (result[0] == '\0'))
return NULL;
else
return eina_stringshare_add(result);
return eina_stringshare_add_length(result, length);
}
static void