Skip to content

Conversation

@Boddlnagg
Copy link
Contributor

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.

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.
@Boddlnagg
Copy link
Contributor Author

The CI seems broken/outdated:

Downloaded libc v0.2.177
error: package `libc v0.2.177` cannot be built because it requires rustc 1.63 or newer, while the currently active rustc version is 1.58.1

};

if current_packet_ptr.is_null() {
panic!("MIDIEventListAdd was unable to add the event")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
panic!("MIDIPacketListAdd was unable to add the packet")
panic!("not enough room in the packet for the event")

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.

2 participants