libsepol: cil: prevent stack buffer overflow in cil_expr_to_string
PATCH 1/1 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 <[email protected]>
--- libsepol/cil/src/cil_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
libsepol/cil/src/cil_tree.c +1 -1
@@ -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; }
Signature · 1 line
2.14.3