From b6d5805c7ad4bfa6d0544a21084e8ec1a47d7391 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Mon, 16 Mar 2015 11:33:07 +0100 Subject: [PATCH] libsemanage: fix fname[] initialization in test_utilities.c There's no guaranty that last item in "char fname[]" will be a null character. Fixes segfault on some systems: Test: semanage_nc_sort ...passedtest_semanage_findval: : Invalid argument libsemanage-tests: TestRun.c:160: CU_assertImplementation: Assertion `((void *)0) != f_pCurTest' failed. make[1]: *** [test] Aborted (core dumped) Signed-off-by: Petr Lautrbach --- libsemanage/tests/test_utilities.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsemanage/tests/test_utilities.c b/libsemanage/tests/test_utilities.c index 4d25b07c..32cc33c1 100644 --- a/libsemanage/tests/test_utilities.c +++ b/libsemanage/tests/test_utilities.c @@ -45,7 +45,7 @@ void test_slurp_file_filter(void); char fname[] = { 'T', 'E', 'S', 'T', '_', 'T', 'E', 'M', 'P', '_', 'X', 'X', 'X', 'X', - 'X', 'X' + 'X', 'X', '\0' }; int fd; FILE *fptr;