Skip to contentSkip to conversation

checkpolicy - no module version

PATCH New Joshua Brindle 1 participant 1 message Oct 4, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 checkpolicy - no module version

This patch corrects an old behavior where module versions could be NULL, this is no longer allowed per the grammar and therefore an error condition.

module_compiler.c +2 -4
diff -pur -x .svn checkpolicy/module_compiler.c checkpolicy/module_compiler.c
@@ -70,10 +70,8 @@ int define_policy(int pass, int module_h
                         }
                         policydbp->name = id;
                         if ((policydbp->version = queue_remove(id_queue)) == NULL) {
-                                if ((policydbp->version = strdup("")) == NULL) {
-                                        yyerror("Out of memory!");
-                                        return -1;
-                                }
+                                yyerror("Expected a module version but none was found.");
+                                return -1;
                         }
                 }
                 /* the first declaration within the global avrule