libsepol: cil: prevent stack buffer overflow in cil_expr_to_string
Fix the test to prevent overflowing the stack buffer for boolean expressions. Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
This commit is contained in:
parent
84b19ae72e
commit
3ca8762efd
1 changed files with 1 additions and 1 deletions
|
@ -339,7 +339,7 @@ static int cil_expr_to_string(struct cil_list *expr, char **out)
|
|||
int pos = 0;
|
||||
|
||||
cil_list_for_each(curr, expr) {
|
||||
if (pos > COND_EXPR_MAXDEPTH) {
|
||||
if (pos >= COND_EXPR_MAXDEPTH) {
|
||||
rc = SEPOL_ERR;
|
||||
goto exit;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue