VirtualBox

Changeset 5864 in vbox for trunk/src/VBox/HostServices


Ignore:
Timestamp:
Nov 28, 2007 3:38:24 PM (17 years ago)
Author:
vboxsync
Message:

Shared clipboard (Linux host): fixed an issue with a too small buffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedClipboard/linux.cpp

    r5805 r5864  
    13071307        return rc;
    13081308    }
    1309     /* Allocate as much space as the Utf16 string takes up, as RTUtf16ToUtf8Ex may fail if the
     1309    /* Allocate enough space, as RTUtf16ToUtf8Ex may fail if the
    13101310       space is too tightly calculated. */
    1311     pu8DestText = XtMalloc(cwDestLen * 2);
     1311    pu8DestText = XtMalloc(cwDestLen * 4);
    13121312    if (pu8DestText == 0)
    13131313    {
    1314         LogRel (("vboxClipboardConvertUtf8: failed to allocate %d bytes\n", cwDestLen * 2));
     1314        LogRel (("vboxClipboardConvertUtf8: failed to allocate %d bytes\n", cwDestLen * 4));
    13151315        RTMemFree(reinterpret_cast<void *>(pu16DestText));
    13161316        vboxClipboardEmptyGuestBuffer();
     
    13181318    }
    13191319    /* Convert the Utf16 string to Utf8. */
    1320     rc = RTUtf16ToUtf8Ex(pu16DestText + 1, cwDestLen - 1, &pu8DestText, cwDestLen * 2,
     1320    rc = RTUtf16ToUtf8Ex(pu16DestText + 1, cwDestLen - 1, &pu8DestText, cwDestLen * 4,
    13211321                         &cbDestLen);
    13221322    RTMemFree(reinterpret_cast<void *>(pu16DestText));
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette