mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-05-01 05:37:58 +02:00
dbus-message-factory: Add some missing OOM paths to an internal test
Coverity ID: 54692 Signed-off-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99724 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
This commit is contained in:
parent
4ce1ea4b78
commit
56eecc0d4d
1 changed files with 12 additions and 7 deletions
|
|
@ -362,19 +362,24 @@ message_with_nesting_levels (int levels)
|
|||
dbus_message_iter_init_append (message, &parents[i]);
|
||||
while (i < levels)
|
||||
{
|
||||
dbus_message_iter_open_container (&parents[i], DBUS_TYPE_VARIANT,
|
||||
i == (levels - 1) ?
|
||||
DBUS_TYPE_INT32_AS_STRING :
|
||||
DBUS_TYPE_VARIANT_AS_STRING,
|
||||
&children[i]);
|
||||
if (!dbus_message_iter_open_container (&parents[i], DBUS_TYPE_VARIANT,
|
||||
i == (levels - 1) ?
|
||||
DBUS_TYPE_INT32_AS_STRING :
|
||||
DBUS_TYPE_VARIANT_AS_STRING,
|
||||
&children[i]))
|
||||
_dbus_assert_not_reached ("oom");
|
||||
++i;
|
||||
parents[i] = children[i-1];
|
||||
}
|
||||
--i;
|
||||
dbus_message_iter_append_basic (&children[i], DBUS_TYPE_INT32, &v_INT32);
|
||||
|
||||
if (!dbus_message_iter_append_basic (&children[i], DBUS_TYPE_INT32, &v_INT32))
|
||||
_dbus_assert_not_reached ("oom");
|
||||
|
||||
while (i >= 0)
|
||||
{
|
||||
dbus_message_iter_close_container (&parents[i], &children[i]);
|
||||
if (!dbus_message_iter_close_container (&parents[i], &children[i]))
|
||||
_dbus_assert_not_reached ("oom");
|
||||
--i;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue