Message ID | 20250225143312.47755-3-cgoettsche@seltendoof.de (mailing list archive) |
---|---|
State | New |
Delegated to: | Petr Lautrbach |
Headers | show |
Series | [1/3] checkpolicy: free left hand conditional expression on error | expand |
On Tue, Feb 25, 2025 at 9:37 AM Christian Göttsche <cgoettsche@seltendoof.de> wrote: > > From: Christian Göttsche <cgzones@googlemail.com> > > On a failure during a binray conditional expression free the left hand > side expression. > > Reported-by: oss-fuzz (issue 398356455) > Signed-off-by: Christian Göttsche <cgzones@googlemail.com> For these three patches: Acked-by: James Carter <jwcart2@gmail.com> > --- > checkpolicy/policy_define.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c > index f19e9f6d..18654d00 100644 > --- a/checkpolicy/policy_define.c > +++ b/checkpolicy/policy_define.c > @@ -4202,6 +4202,7 @@ cond_expr_t *define_cond_expr(uint32_t expr_type, void *arg1, void *arg2) > if (!e1 || e1->next) { > yyerror > ("illegal right side of conditional binary op expression"); > + cond_expr_destroy(arg1); > free(expr); > return NULL; > } > -- > 2.47.2 > >
diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c index f19e9f6d..18654d00 100644 --- a/checkpolicy/policy_define.c +++ b/checkpolicy/policy_define.c @@ -4202,6 +4202,7 @@ cond_expr_t *define_cond_expr(uint32_t expr_type, void *arg1, void *arg2) if (!e1 || e1->next) { yyerror ("illegal right side of conditional binary op expression"); + cond_expr_destroy(arg1); free(expr); return NULL; }