aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHaldun Bayhantopcu <haldun@github.com>2023-10-31 13:35:09 +0100
committergit <svn-admin@ruby-lang.org>2023-10-31 12:54:13 +0000
commit3801503fe3d5c1440bc4e47a60e3e3bf5a22255d (patch)
treefd12e809ecf6bc0662aee833c5e8aa4b0dd158bf
parentb0a2373e14d475cfcf6ce21d25cbde2518c0dddc (diff)
downloadruby-3801503fe3d5c1440bc4e47a60e3e3bf5a22255d.tar.gz
[ruby/prism] Fix a possible malloc(0)
https://github.com/ruby/prism/commit/fa108b8626
-rw-r--r--prism/prism.c2
1 files changed, 1 insertions, 1 deletions
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();