Skip to content

Comments

Fix panic on empty mapping value at EOF#123

Open
lepton9 wants to merge 2 commits intokubkon:mainfrom
lepton9:parser-value-eof
Open

Fix panic on empty mapping value at EOF#123
lepton9 wants to merge 2 commits intokubkon:mainfrom
lepton9:parser-value-eof

Conversation

@lepton9
Copy link

@lepton9 lepton9 commented Feb 21, 2026

This fixes a crash when parsing an entry with an empty value at end-of-file.

The parser consumes the .eof token while returning .none, leaving token_it.pos past the end of the token buffer. Later, in Parser.map() the Parser.getCol() causes the OOB access.

This should be valid YAML and pass:

test "empty map value at eof" {
    try parseSuccess(
        \\key:
        \\
    );
}

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.

1 participant