[PATCH 5/6] mcstrans: do not dereference color_str if it is NULL

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

 



This bug has been found using clang static analyzer.

Signed-off-by: Nicolas Iooss <nicolas.iooss@xxxxxxx>
---
 mcstrans/src/mcscolor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mcstrans/src/mcscolor.c b/mcstrans/src/mcscolor.c
index e713da9aea1f..cc6174bba9d5 100644
--- a/mcstrans/src/mcscolor.c
+++ b/mcstrans/src/mcscolor.c
@@ -292,7 +292,7 @@ int raw_color(const security_context_t raw, char **color_str) {
 	size_t result_size = (N_COLOR * CHARS_PER_COLOR) + 1;
 	int rc = -1;
 
-	if (!color_str && !*color_str) {
+	if (!color_str || !*color_str) {
 		return -1;
 	}
 
-- 
2.11.1

_______________________________________________
Selinux mailing list
Selinux@xxxxxxxxxxxxx
To unsubscribe, send email to Selinux-leave@xxxxxxxxxxxxx.
To get help, send an email containing "help" to Selinux-request@xxxxxxxxxxxxx.



[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux