-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8237495: Java MIDI fails with a dereferenced memory error when asked to send a raw 0xF7 #1135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…to send a raw 0xF7
|
👋 Welcome back serb! A progress list of the required criteria for merging this PR into |
|
@mrserb This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 5 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
|
/integrate |
|
@mrserb Since your change was applied there have been 31 commits pushed to the
Your commit was automatically rebased without conflicts. Pushed as commit 5de99da. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
…to send a raw 0xF7 Reviewed-by: kizune
The JavaSound supports the special system exclusive message(SysexMessage).
An important part of the spec:
In short, the text above can be represented by these examples:
SysexMessage{0xF0, some_data, 0xF7}SysexMessage{0xF0,some_data}, SysexMessage{0xF7,some_data}, SysexMessage{0xF7,some_data}, SysexMessage{0xF7,some_data, 0xF7}.Note that the second case above the "SysexMessage{0xF7,some_data}" is named as a "continuation" sysex messages.
Usually, when a create a sysex message we carefully calculate the size of the message before sending it to the native code, but the "continuation" sysex messages were implemented in 2003 directly in native after all checks are done, and it just skips the status byte and tries to push nonexistent data to the native device.
So the culprit is in the message like this:
SysexMessage{0xF0,some_data}, SysexMessage{0xF7}.The code assumes that the second message is "continuation", but it does not, it just ends the previous message.
After the fix, we will not consider the 0xF7 as a continuation if there are no data after.
Progress
Testing
Failed test task
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jdk pull/1135/head:pull/1135$ git checkout pull/1135