DBusMessageIter: Zero out the iterator on failure
authorSimon McVittie <smcv@collabora.com>
Tue, 4 Jul 2017 15:04:07 +0000 (16:04 +0100)
committerSimon McVittie <smcv@collabora.com>
Wed, 5 Jul 2017 12:14:14 +0000 (13:14 +0100)
commited1f7af78cc979d3ab7d293753bae3a7130d3774
tree099b6b8cf6d15169d1e332c55eae2043a6060b4e
parent5ef22e40f25e35b630d9610c2f68e07ee1abf446
DBusMessageIter: Zero out the iterator on failure

This ensures that callers won't accidentally use it for something
in a way that is considered to be programmer error.

In _dbus_message_iter_check(), insert a specific check for this before
dereferencing iter->message, so that we get a nice assertion failure
(potentially non-fatal) instead of a segfault.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=101568
dbus/dbus-message.c