-
Notifications
You must be signed in to change notification settings - Fork 22
Check for null pointer after MIDIPacketListAdd/MIDIEventListAdd #58
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
base: master
Are you sure you want to change the base?
Conversation
MIDIPacketListAdd/MIDIEventListAdd can return null pointers. This leads to unsoundness. Ideally the error would be handled by the caller, but that requires a changed signature. So a panic is the best we can do for now.
|
The CI seems broken/outdated: |
| }; | ||
|
|
||
| if current_packet_ptr.is_null() { | ||
| panic!("MIDIEventListAdd was unable to add the event") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| panic!("MIDIEventListAdd was unable to add the event") | |
| panic!("not enough room in the packet for the event") |
| }; | ||
|
|
||
| if current_packet_ptr.is_null() { | ||
| panic!("MIDIPacketListAdd was unable to add the packet") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| panic!("MIDIPacketListAdd was unable to add the packet") | |
| panic!("not enough room in the packet for the event") |
| }; | ||
|
|
||
| if current_packet_ptr.is_null() { | ||
| panic!("MIDIPacketListAdd was unable to add the packet") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| panic!("MIDIPacketListAdd was unable to add the packet") | |
| panic!("not enough room in the packet for the event") |
MIDIPacketListAdd/MIDIEventListAdd can return null pointers. This leads to unsoundness (see #57).
Ideally the error would be handled by the caller, but that requires a changed signature. So a panic is the best we can do for now.