fix(command): avoid command-string injection in show-text and out-of-range in cycle-audio#774
Open
Noethix55555 wants to merge 1 commit into
Open
Conversation
…range in cycle-audio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two fixes in Command.cs:
ShowText injection:
ShowTextbuilt a rawmpv_command_stringby concatenating the caller-suppliedtextdirectly. A double-quote in a media track title (e.g.He said hello) breaks the command. Fix: usePlayer.CommandV(show-text, ...)so each argument is a separate C string with no shell quoting needed.CycleAudio out-of-range:
CycleAudioalways calledtracks[aid - 1], butaidcan be 0 when audio is disabled, or can exceedtracks.Lengthwhen external audio files have non-contiguous track IDs. Either case throwsIndexOutOfRangeException. Fix: guard withif (aid < 1 || aid > tracks.Length) returnbefore indexing.