mcstrans: do not dereference color_str if it is NULL

This bug has been found using clang static analyzer.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
This commit is contained in:
Nicolas Iooss 2017-02-27 21:39:34 +01:00 committed by James Carter
parent ccfbd9aa17
commit 6305bfbc00
1 changed files with 1 additions and 1 deletions

View File

@ -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; size_t result_size = (N_COLOR * CHARS_PER_COLOR) + 1;
int rc = -1; int rc = -1;
if (!color_str && !*color_str) { if (!color_str || !*color_str) {
return -1; return -1;
} }