[glib-networking] tests: Fix addressing of buffers in tests



commit 281295230c61d8e8aaa3148ec96bb54f183c2839
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Jan 10 12:03:27 2018 +0000

    tests: Fix addressing of buffers in tests
    
    They were being referenced once too much, which was causing the tests to
    write into arbitrary memory.
    
    Coverity CID: 249795
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792402

 tls/tests/dtls-connection.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/tls/tests/dtls-connection.c b/tls/tests/dtls-connection.c
index a05b6b1..a6d2a2d 100644
--- a/tls/tests/dtls-connection.c
+++ b/tls/tests/dtls-connection.c
@@ -602,8 +602,8 @@ read_test_data_async (TestConnection *test)
   GError *error = NULL;
   guint8 buf[TEST_DATA_LENGTH * 2];
   GInputVector vectors[2] = {
-    { &buf, sizeof (buf) / 2 },
-    { &buf + sizeof (buf) / 2, sizeof (buf) / 2 },
+    { buf, sizeof (buf) / 2 },
+    { buf + sizeof (buf) / 2, sizeof (buf) / 2 },
   };
   GInputMessage message = { NULL, vectors, G_N_ELEMENTS (vectors), 0, 0, NULL, NULL };
   gint n_read;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]