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:
parent
ccfbd9aa17
commit
6305bfbc00
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue