diff options
| author | Haldun Bayhantopcu <haldun@github.com> | 2023-10-31 13:35:09 +0100 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2023-10-31 12:54:13 +0000 |
| commit | 3801503fe3d5c1440bc4e47a60e3e3bf5a22255d (patch) | |
| tree | fd12e809ecf6bc0662aee833c5e8aa4b0dd158bf | |
| parent | b0a2373e14d475cfcf6ce21d25cbde2518c0dddc (diff) | |
[ruby/prism] Fix a possible malloc(0)
https://github.com/ruby/prism/commit/fa108b8626
| -rw-r--r-- | prism/prism.c | 2 |
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(); |
