[PATCH 2/3] libtracefs: Avoid null access

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

 



The for loop handles devents == NULL, but the test afterwards needs to
also.

Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
 utest/tracefs-utest.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/utest/tracefs-utest.c b/utest/tracefs-utest.c
index 5163004..7042fa9 100644
--- a/utest/tracefs-utest.c
+++ b/utest/tracefs-utest.c
@@ -433,7 +433,7 @@ static void test_synth_compare(struct test_synth *synth, struct tracefs_dynevent
 		free(event);
 		free(format);
 	}
-	CU_TEST(devents[i] == NULL);
+	CU_TEST(devents == NULL || devents[i] == NULL);
 }
 
 static void test_instance_synthetic(struct tracefs_instance *instance)
-- 
2.35.1.574.g5d30c73bfb-goog




[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux