From 77f7948dc2761db5774b33d32f4b11ffc3457d3e Mon Sep 17 00:00:00 2001 From: follower Date: Tue, 7 Nov 2017 22:23:34 +1300 Subject: [PATCH] Fix off-by-one/heap-buffer-overflow as reported by ASAN. It's probably not the best "solution" but it should hopefully be one less category of crash-on-close on Mac. ASAN a.k.a Clang "AddressSanitizer". --- src/core/midi/MidiApple.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/midi/MidiApple.cpp b/src/core/midi/MidiApple.cpp index 45f58e4bb1b..f4bc0d4dd97 100644 --- a/src/core/midi/MidiApple.cpp +++ b/src/core/midi/MidiApple.cpp @@ -615,7 +615,7 @@ char * MidiApple::getFullName(MIDIEndpointRef &endpoint_ref) char * deviceName = getName(device); char * endPointName = getName(endpoint_ref); qDebug("device name='%s' endpoint name='%s'",deviceName,endPointName); - char * fullName = (char *)malloc(strlen(deviceName) + strlen(endPointName)+1); + char * fullName = (char *)malloc(strlen(deviceName) + strlen(":") + strlen(endPointName)+1); sprintf(fullName, "%s:%s", deviceName,endPointName); return fullName; }