Fix off-by-one error when unmarshalling multiple return values. (Reported by Marcus Müller)

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/dbuskit/trunk@37642 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Niels Grewe 2014-01-29 09:18:22 +00:00
parent 433c159d5c
commit 88265c5ae2
2 changed files with 10 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2014-01-29 Niels Grewe <niels.grewe@halbordnung.de>
* Source/DKMethod.m: Fix off-by-one error when unmarshalling
multiple return values.
2014-01-29 Niels Grewe <niels.grewe@halbordnung.de>
* Documentation/UsingDBus.texi: Document how

View File

@ -563,11 +563,13 @@
* Proceed to the next value in the message, but raise an exception if
* we are missing some.
*/
if (NO == (BOOL)dbus_message_iter_next(iter))
if ((NO == (BOOL)dbus_message_iter_next(iter))
&& (numArgs > (index + 1)))
{
DKArgument *nextArg = [outArgs objectAtIndex: index + 1];
[NSException raise: @"DKMethodUnmarshallingException"
format: @"D-Bus message too short when unmarshalling return value for '%@'.",
name];
format: @"D-Bus message too short when unmarshalling return value for '%@'. Expected value for argument %@ of type %c.",
name, [nextArg name], [nextArg DBusType]];
}
index++;
}