lib/tst_bool_expr: Clear priv pointer on token insertion
PATCH 1/1 lib/tst_bool_expr: Clear priv pointer on token insertion
We are using the priv pointer to store an error message but as it wasn't initialized from the start it may have contianed random data leading to a crash on a parser error reports.
Reported-by Petr Vorel <[email protected]>
Tested-by Petr Vorel <[email protected]>
Signed-off-by Cyril Hrubis <[email protected]>
--- lib/tst_bool_expr.c | 1 + 1 file changed, 1 insertion(+)
lib/tst_bool_expr.c +1 -0
@@ -55,6 +55,7 @@ static int new_tok(struct tst_expr_tok **last, const char *tok, size_t tok_len) (*last)->tok = tok; (*last)->tok_len = tok_len; (*last)->op =char_to_op (tok[0 ]); + (*last)->priv =NULL ; (*last)++;return 1 ;
Signature · 1 line
2.31.1