From 0e210cc91233378db959f75535b8a8c759eb0a30 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 1 Jul 2019 10:38:42 +0200 Subject: Fix uninitialize return status in fstree_relabel_selinux Should the inode table theoretically be empty, the function returns an undefined value. This commit fixes that case by initializing the return status to 0, so it returns success status in that case. Bug found using scan-build. Signed-off-by: David Oberhollenzer --- lib/fstree/selinux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fstree/selinux.c b/lib/fstree/selinux.c index b7934ea..ceaac06 100644 --- a/lib/fstree/selinux.c +++ b/lib/fstree/selinux.c @@ -43,7 +43,7 @@ int fstree_relabel_selinux(fstree_t *fs, const char *filename) { SELABEL_OPT_PATH, filename }, }; size_t i; - int ret; + int ret = 0; sehnd = selabel_open(SELABEL_CTX_FILE, seopts, 1); -- cgit v1.2.3