1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-18 00:54:19 +00:00

Linux: Fix a out-of-bounds memory write when copying text to the clipboard

This commit is contained in:
Tom Poole 2022-01-20 11:58:01 +00:00
parent bbbb967c63
commit 06db7f074e

View file

@ -1361,8 +1361,10 @@ namespace ClipboardHelpers
{
// another application wants to know what we are able to send
numDataItems = 2;
propertyFormat = 32; // atoms are 32-bit
data.calloc (numDataItems * 4);
constexpr size_t atomSize = sizeof (Atom);
static_assert (atomSize == 8, "Atoms are 32-bit");
propertyFormat = atomSize * 4;
data.calloc (numDataItems * atomSize);
auto* dataAtoms = unalignedPointerCast<Atom*> (data.getData());