Skip to content
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

Array index overflow in Midi(In|Out)Jack :: getPortName #23

Closed
keinstein opened this issue Apr 12, 2014 · 0 comments
Closed

Array index overflow in Midi(In|Out)Jack :: getPortName #23

keinstein opened this issue Apr 12, 2014 · 0 comments

Comments

@keinstein
Copy link

The getPortName functions of the JACK backend use the port number unchecked and thus may read after the end of the ports array without notice.

This may be a security issue for applications that allow remote access to the port selection.

Note: There is no way to protect the code from the application side. The JACK backend suffers from the same race condition as the ALSA backend: If a port is added or removed between two calls to RtMidi the serial port number may have changed some ports may have been removed from the list. New ports might appear if the type of ports is changed during runtime and – depending on the internal operation of jack_get_ports – if a client adds ports (I didn't check the latter as it doesn't change much). Thus, it is not possible to circumvent this problem using getPortCount().

P.S.: I noticed this issue while writing the JACK implementation for #21 .

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

No branches or pull requests

1 participant