Skip to content

Commit

Permalink
Fix off-by-one/heap-buffer-overflow as reported by ASAN.
Browse files Browse the repository at this point in the history
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.
2 changes: 1 addition & 1 deletion src/core/midi/MidiApple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit eb09ff6

Please sign in to comment.