summaryrefslogtreecommitdiff
path: root/include/ruby/backward
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2025-07-17 11:10:41 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2025-07-17 15:01:02 -0400
commitdabdd81d178ed91ca0feb0875ce0df927df0f3fb (patch)
tree463707ee872b773c3994f355525d0f4e0b478b39 /include/ruby/backward
parentcb33f22f5b64b4d12cda7b7222898c3b20438fcc (diff)
Fix linked list iteration when displaying errors
When a script has problem with the magic comment encoding, we only display that error. However, if there are other syntax errors in the file, the error linked list could contain multiple items. This lead to an inconsistency in the "size" field of the linked list, and the actual items in the linked list. In other words, the linked list had more than one item, but the size field was one. The error display routine would only allocate `size` items, but iterating the linked list would overrun the array. This commit changes the iterator to compare the current node to the "finish" node in the linked list, no longer assuming the linked list ends with NULL. [Bug #21461]
Diffstat (limited to 'include/ruby/backward')
0 files changed, 0 insertions, 0 deletions