1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-02 03:20:06 +00:00

BLOCKS: Fixed a potential memory overflow in a recent commit

This commit is contained in:
hogliux 2017-08-24 12:38:48 +01:00
parent 8e7a2072eb
commit 9c5cd5a188

View file

@ -363,8 +363,13 @@ struct PhysicalTopologySource::Internal
static bool versionNumberAddedToBlock (const juce::Array<DeviceInfo>& devices, Block::UID uid, juce::String version) noexcept
{
for (auto&& d : devices)
if (d.uid == uid && memcmp (d.version.version, version.toRawUTF8(), d.version.length) != 0)
{
String deviceVersion (reinterpret_cast<const char*> (d.version.version),
jmin (static_cast<size_t> (d.version.length), sizeof (d.version.version)));
if (d.uid == uid && deviceVersion != version)
return true;
}
return false;
}