Skip to content

Early return when nothing to be escaped. - #151

Merged
nobu merged 1 commit into
ruby:masterfrom
nobu:alert-alloca-in-loop
Oct 3, 2026
Merged

nobu merged 1 commit into
ruby:masterfrom
nobu:alert-alloca-in-loop

Conversation

@nobu

@nobu nobu commented Oct 3, 2026

Copy link
Copy Markdown
Member

Fix false code-scanning alert 1590, "Call to alloca in a loop", by moving the intermediate buffer allocation outside the loop. Although this allocation is technically inside the loop, it is actually located within the if (!buf) block and is executed only once.

Fix false code-scanning alert [1590], "Call to alloca in a loop", by
moving the intermediate buffer allocation outside the loop.  Although
this allocation is technically inside the loop, it is actually located
within the `if (!buf)` block and is executed only once.

[1590]: https://github.com/ruby/ruby/security/code-scanning/1590

Co-authored-by: nobu <nobu@ruby-lang.org>
@nobu
nobu merged commit 2bed7cf into ruby:master Oct 3, 2026
16 checks passed
@nobu
nobu deleted the alert-alloca-in-loop branch October 3, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants