summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2024-09-20 21:33:38 +1000
committerMarge Bot <emma+marge@anholt.net>2024-09-30 15:35:36 +0000
commit54dccd66d102600e98788f60ff6228d127d6ac54 (patch)
tree00fc76c8bbc763f949a8a7693338cf249eedb6ac /test
parent1790171c769b306731c0e7d092da61a3344feb64 (diff)
Fix a few potential NULL dereferences
Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1052>
Diffstat (limited to 'test')
-rw-r--r--test/test-utils.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/test-utils.c b/test/test-utils.c
index ee9cc606..d1b7345a 100644
--- a/test/test-utils.c
+++ b/test/test-utils.c
@@ -1218,8 +1218,10 @@ START_TEST(double_array_from_string_test)
&len);
ck_assert_int_eq(len, t->len);
- for (size_t idx = 0; idx < len; idx++)
+ for (size_t idx = 0; idx < len; idx++) {
+ ck_assert_ptr_nonnull(array);
ck_assert_double_eq(array[idx], t->array[idx]);
+ }
free(array);
t++;