selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] libsemanage/tests: return when str is NULL
@ 2019-09-30 20:22 Nicolas Iooss
  2019-09-30 20:22 ` [PATCH 2/2] libsemanage/tests: check that string pointers are not NULL before comparing them Nicolas Iooss
  0 siblings, 1 reply; 3+ messages in thread
From: Nicolas Iooss @ 2019-09-30 20:22 UTC (permalink / raw)
  To: selinux

CU_FAIL() does not stop the execution flow.

This issue has been found using Infer static analyzer.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 libsemanage/tests/test_utilities.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libsemanage/tests/test_utilities.c b/libsemanage/tests/test_utilities.c
index ba995b5ae094..fa3a077f5e92 100644
--- a/libsemanage/tests/test_utilities.c
+++ b/libsemanage/tests/test_utilities.c
@@ -142,6 +142,7 @@ void test_semanage_split_on_space(void)
 	if (!str) {
 		CU_FAIL
 		    ("semanage_split_on_space: unable to perform test, no memory");
+		return;
 	}
 	temp = semanage_split_on_space(str);
 	CU_ASSERT_STRING_EQUAL(temp, "bar    baz");
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-01 19:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30 20:22 [PATCH 1/2] libsemanage/tests: return when str is NULL Nicolas Iooss
2019-09-30 20:22 ` [PATCH 2/2] libsemanage/tests: check that string pointers are not NULL before comparing them Nicolas Iooss
2019-10-01 19:02   ` Stephen Smalley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).