Browse Source

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

v6.1.6
Tom Poole 4 years ago
parent
commit
06db7f074e
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp

+ 4
- 2
modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp 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());


Loading…
Cancel
Save