Skip to content

Commit eb09ff6

Browse files
followerlukas-w
authored andcommitted
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".
1 parent 298f1ec commit eb09ff6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/core/midi/MidiApple.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ char * MidiApple::getFullName(MIDIEndpointRef &endpoint_ref)
615615
char * deviceName = getName(device);
616616
char * endPointName = getName(endpoint_ref);
617617
qDebug("device name='%s' endpoint name='%s'",deviceName,endPointName);
618-
char * fullName = (char *)malloc(strlen(deviceName) + strlen(endPointName)+1);
618+
char * fullName = (char *)malloc(strlen(deviceName) + strlen(":") + strlen(endPointName)+1);
619619
sprintf(fullName, "%s:%s", deviceName,endPointName);
620620
return fullName;
621621
}

0 commit comments

Comments
 (0)