Skip to content

fix: skip space-free lines in InputHelp.Parse to avoid IndexOf -1 crash#780

Open
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/inputconf-no-space-crash
Open

fix: skip space-free lines in InputHelp.Parse to avoid IndexOf -1 crash#780
Noethix55555 wants to merge 1 commit into
mpvnet-player:mainfrom
Noethix55555:fix/inputconf-no-space-crash

Conversation

@Noethix55555

Copy link
Copy Markdown

InputHelp.Parse called line[..line.IndexOf(" ")] without guarding against the -1 return value that IndexOf produces when no space is present. A space-free line in input.conf (bare key, garbage line, etc.) triggers an ArgumentOutOfRangeException and crashes the input editor.

Fix: capture the index first, and continue to the next line if it is negative. The rest of the parsing loop is unaffected.

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