policycoreutils/hll/pp: Fix pp crash when processing base module
PATCH 1/1 policycoreutils/hll/pp: Fix pp crash when processing base module
Policy module structure created by libsepol out of base module contains NULL in module name, which results in segfault in "pp" compiler. Add NULL check.
Signed-off-by Vit Mojzis <[email protected]>
--- policycoreutils/hll/pp/pp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/hll/pp/pp.c +1 -1
@@ -141,7 +141,7 @@ int main(int argc, char **argv)if (separator) { *separator ='\0' ; } -if (strcmp (mod_name, cil_name) !=0 ) { +if (mod_name &&strcmp (mod_name, cil_name) !=0 ) {fprintf (stderr,"Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n" , ifile, mod_name, cil_name); }free (cil_path);
Signature · 1 line
2.7.4
Stephen Smalley
AppliedQuoted 5 lines · Vit Mojzis
Policy module structure created by libsepol out of base module contains NULL in module name, which results in segfault in "pp" compiler. Add NULL check.
Thanks, applied.
Quoted 22 lines
Signed-off-by Vit Mojzis <[email protected]>---
policycoreutils/hll/pp/pp.c | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)policycoreutils/hll/pp/pp.c +1
-1@@ -141,7 +141,7 @@ int main(int argc, char **argv) if (separator) { *separator = '\0'; } -if (strcmp (mod_name, cil_name) !=0 ) { +if (mod_name &&strcmp (mod_name, cil_name) !=0 ) {fprintf(stderr, "Warning: SELinux
userspace will refer to the module from %s as %s rather than %s\n", ifile,mod_name,cil_name);
}
free(cil_path);