eldbus: fix _eldbus_message_iter_arguments_vget
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>
Fri, 2 Oct 2015 07:13:48 +0000 (09:13 +0200)
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>
Fri, 2 Oct 2015 07:14:29 +0000 (09:14 +0200)
commit47541b81c6a6b53f4a5305f1aa226cbf451487c7
treecf65c05b17e8af6a8a44de0b237c3e81e05d1e29
parent73f9ca62970062b08efce3c09613f7a30657dd9e
eldbus: fix _eldbus_message_iter_arguments_vget

Summary:
there is a problem with _eldbus_message_iter_arguments_vget.

Assume: We have a array of type y, there are 3 elements in the array.

Lets say we are iterating with

printf("%c", dbus_message_iter_get_arg_type(iter));

and

dbus_message_iter_next(iter);

throuw the iter.

You will see that this will output yyy. As we are having 3 times v.
While the signature of the message iterator is y.

If you now call eldbus_message_iter_arguments_get(message, "y", &cont)
it will return false, with the errormessage in line 766, reason for this
is that the type of the signature iterator differs from the message
iterator. Because of the upper example.
So all in all: The signature given to the method has not to be equal to
the signature of the message iterator, it has to be equal to the
iterated signature, which cannot be found easily with the eldbus api.

The solution is to only iterate in the message iterator that long until
the signature iterator is at the end, if the type differs in this
region, give a error and return false. Otherwise return true.

The sad thing about this is that it is a behaviour break, but the
behaviour is borked, so its a fix.

I tested this over a week now, without any problem in efl/elm/e.

Reviewers: stefan_schmidt, zmike

Reviewed By: stefan_schmidt

Subscribers: zmike, ceolin, simotek, DaveMDS, cedric

Projects: #efl

Differential Revision: https://phab.enlightenment.org/D3074
src/lib/eldbus/eldbus_message.c