celtera / libremidi

A modern C++ MIDI 1 / MIDI 2 real-time & file I/O library. Supports Windows, macOS, Linux and WebMIDI.
Other
463 stars 51 forks source link

[mac] Don't segfault on ports with missing properties / Use an empty string for missing port properties #103

Closed mccann closed 8 months ago

mccann commented 8 months ago

MacOS 14, Apple Silicon

Found a bug when I modified the midiprobe example to enumerate virtual ports created by the coremidi_share example:

libremidi::observer midi{ {.track_virtual = true },libremidi::observer_configuration_for(api) };

When running the coremidi_share in one terminal, and the modified mididprobe in another, midiprobe would segfault inside get_string_property due to nullptr dereference of CFStringRef res inside CFStringGetCString(res,...)

nhielost commented 8 months ago

I was just about to write an issue for this, but you beat me to it.