From 3801503fe3d5c1440bc4e47a60e3e3bf5a22255d Mon Sep 17 00:00:00 2001 From: Haldun Bayhantopcu Date: Tue, 31 Oct 2023 13:35:09 +0100 Subject: [PATCH] [ruby/prism] Fix a possible malloc(0) https://github.com/ruby/prism/commit/fa108b8626 --- prism/prism.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/prism/prism.c b/prism/prism.c index 9ab674de48..7e5d3e48b6 100644 --- a/prism/prism.c +++ b/prism/prism.c @@ -15069,7 +15069,7 @@ parse_expression_infix(pm_parser_t *parser, pm_node_t *node, pm_binding_power_t } } - if (!interpolated) { + if (!interpolated && total_length > 0) { void *memory = malloc(total_length); if (!memory) abort();