summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <withnall@endlessm.com>2017-04-05 11:35:27 +0100
committerSimon McVittie <smcv@debian.org>2017-04-05 16:22:22 +0100
commit9e864c2e4b43b81db110bf506968fd0caa8558a1 (patch)
treea7792464602e29df636d0147d9fdaad5fb739223
parentd7ff4e5b1e0a984c7de0019fe907dfad82590f9e (diff)
downloaddbus-9e864c2e4b43b81db110bf506968fd0caa8558a1.tar.gz
test: Fix reading off the end of an array in test-corrupt
One level of pointer indirection too many when passing the arguments to dbus_message_append_args(). Bug: https://bugs.freedesktop.org/show_bug.cgi?id=100568 Signed-off-by: Philip Withnall <withnall@endlessm.com> Reviewed-by: Simon McVittie <smcv@collabora.com>
-rw-r--r--test/corrupt.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/test/corrupt.c b/test/corrupt.c
index d106fcc5..56a0cdf2 100644
--- a/test/corrupt.c
+++ b/test/corrupt.c
@@ -271,7 +271,6 @@ test_byte_order (Fixture *f,
int fd;
char *blob;
const gchar *arg = not_a_dbus_message;
- const gchar * const *args = &arg;
int blob_len;
DBusMessage *message;
dbus_bool_t mem;
@@ -283,7 +282,7 @@ test_byte_order (Fixture *f,
/* Append 0xFF bytes, so that the length of the body when byte-swapped
* is 0xFF000000, which is invalid */
mem = dbus_message_append_args (message,
- DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &args, 0xFF,
+ DBUS_TYPE_ARRAY, DBUS_TYPE_BYTE, &arg, 0xFF,
DBUS_TYPE_INVALID);
g_assert (mem);
mem = dbus_message_marshal (message, &blob, &blob_len);