summaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-09-12 13:07:15 +0100
committerSimon McVittie <smcv@collabora.com>2022-10-07 14:15:40 +0100
commit831e8ac273d166f9b5347782f0a91f5c5e1aede0 (patch)
tree7d6c99738b11e8c7b9c6e6f43eb750a43d521aa2 /dbus
parentfdad11b74e29296549bff634f34315eed87ce993 (diff)
downloaddbus-831e8ac273d166f9b5347782f0a91f5c5e1aede0.tar.gz
dbus-marshal-validate: Add an extra assertion
We already checked that claimed_len <= (end - p), therefore we can assume that claimed_len + p <= end. Make this a bit more obvious. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'dbus')
-rw-r--r--dbus/dbus-marshal-validate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/dbus/dbus-marshal-validate.c b/dbus/dbus-marshal-validate.c
index 7d0d6cf7..28e622f7 100644
--- a/dbus/dbus-marshal-validate.c
+++ b/dbus/dbus-marshal-validate.c
@@ -495,6 +495,9 @@ validate_body_helper (DBusTypeReader *reader,
_dbus_type_reader_recurse (reader, &sub);
array_end = p + claimed_len;
+ /* We effectively already checked this, by checking that
+ * claimed_len <= (end - p) */
+ _dbus_assert (array_end <= end);
array_elem_type = _dbus_type_reader_get_element_type (reader);