mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-14 01:54:42 +00:00
libsepol/cil: Check the token type after getting the next token
In add_hll_linemark(), cil_lexer_next() is called and the token type is not checked after the call for the expected type (SYMBOL). Check that the token type is SYMBOL after calling cil_lexer_next(). Signed-off-by: James Carter <jwcart2@gmail.com>
This commit is contained in:
parent
8823bea1b0
commit
2b988acf44
@ -111,6 +111,10 @@ static int add_hll_linemark(struct cil_tree_node **current, uint32_t *hll_lineno
|
|||||||
unsigned long val;
|
unsigned long val;
|
||||||
|
|
||||||
cil_lexer_next(&tok);
|
cil_lexer_next(&tok);
|
||||||
|
if (tok.type != SYMBOL) {
|
||||||
|
cil_log(CIL_ERR, "Invalid line mark syntax\n");
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
hll_type = cil_strpool_add(tok.value);
|
hll_type = cil_strpool_add(tok.value);
|
||||||
if (hll_type == CIL_KEY_HLL_LME) {
|
if (hll_type == CIL_KEY_HLL_LME) {
|
||||||
if (cil_stack_is_empty(stack)) {
|
if (cil_stack_is_empty(stack)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user