Skip to content
Permalink
Browse files
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".
  • Loading branch information
follower authored and lukas-w committed Nov 7, 2017
1 parent 298f1ec commit eb09ff6
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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;
}

0 comments on commit eb09ff6

Please sign in to comment.