[librest] tests: fix potential null pointer dereference



commit c1cbf600818ab0c83d74b9705e1ef98dac35fc13
Author: Günther Wagner <info gunibert de>
Date:   Thu Oct 21 22:09:28 2021 +0200

    tests: fix potential null pointer dereference

 tests/proxy-continuous.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/tests/proxy-continuous.c b/tests/proxy-continuous.c
index 8f4b7a8..54c1bb6 100644
--- a/tests/proxy-continuous.c
+++ b/tests/proxy-continuous.c
@@ -88,7 +88,7 @@ _call_continuous_cb (RestProxyCall *call,
   g_assert_no_error (error);
   g_assert (REST_IS_PROXY (weak_object));
 
-  if (buf == NULL && len == 0)
+  if (buf == NULL || len == 0)
     g_assert (client_count == NUM_CHUNKS * SIZE_CHUNK);
 
   for (i = 0; i < len; i++)


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