summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-marshal.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbus/dbus-marshal.c')
-rw-r--r--dbus/dbus-marshal.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/dbus/dbus-marshal.c b/dbus/dbus-marshal.c
index e19e36bb..7524452b 100644
--- a/dbus/dbus-marshal.c
+++ b/dbus/dbus-marshal.c
@@ -2116,7 +2116,10 @@ _dbus_marshal_validate_arg (const DBusString *str,
len = demarshal_and_validate_len (str, byte_order, pos, &pos);
if (len < 0)
- return FALSE;
+ {
+ _dbus_verbose ("invalid array length (<0)\n");
+ return FALSE;
+ }
if (len > _dbus_string_get_length (str) - pos)
{
@@ -2126,10 +2129,13 @@ _dbus_marshal_validate_arg (const DBusString *str,
end = pos + len;
- if (!validate_array_data (str, byte_order, depth + 1,
- array_type, array_type_pos,
- pos, &pos, end))
- return FALSE;
+ if (len > 0 && !validate_array_data (str, byte_order, depth + 1,
+ array_type, array_type_pos,
+ pos, &pos, end))
+ {
+ _dbus_verbose ("invalid array data\n");
+ return FALSE;
+ }
if (pos < end)
{