Skip to content

fix out-of-bounds read in structname2obj on a trailing colon - #480

Merged
ohler55 merged 1 commit into
ohler55:developfrom
shamsManna:structname-trailing-colon-overread
Nov 5, 2026
Merged

ohler55 merged 1 commit into
ohler55:developfrom
shamsManna:structname-trailing-colon-overread

Conversation

@shamsManna

Copy link
Copy Markdown
Contributor

in mode: :object a struct element's c attribute is the class name, and structname2obj steps over a :: separator with an unconditional s += 2, so a name ending in a single colon such as <u c="Foo:"> skips the terminating NUL and rb_intern reads on past the attribute into the rest of the document (the looked-up constant came back as Struct::>...the following bytes...); only step over a second colon when one is actually there, the way classname2class already guards it.

@ohler55
ohler55 merged commit 0deaec2 into ohler55:develop Nov 5, 2026
20 checks passed
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