VirtualBox

Changeset 69656 in vbox for trunk


Ignore:
Timestamp:
Nov 11, 2017 11:08:43 AM (7 years ago)
Author:
vboxsync
Message:

HostServices/SharedClipboard/X11: fix problems reported by the gcc sanitiser.
9041: clipboard sharing on macOS host is brittle, Guest->Host direction

Location:
trunk/src/VBox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/SharedClipboard/x11-clipboard.cpp

    r69629 r69656  
    920920void ClipDestructX11(CLIPBACKEND *pCtx)
    921921{
    922     /*
    923      * Immediately return if we are not connected to the X server.
    924      */
    925     if (!pCtx->fHaveX11)
    926         return;
    927 
    928     /* We set this to NULL when the event thread exits.  It really should
    929      * have exited at this point, when we are about to unload the code from
    930      * memory. */
    931     Assert(pCtx->widget == NULL);
     922    if (pCtx->fHaveX11)
     923        /* We set this to NULL when the event thread exits.  It really should
     924         * have exited at this point, when we are about to unload the code from
     925         * memory. */
     926        Assert(pCtx->widget == NULL);
     927    RTMemFree(pCtx);
    932928}
    933929
     
    21892185    }
    21902186    clipConvertX11CB(closure, pValue, count * format / 8);
     2187    if (pValue)
     2188        RTMemFree(pValue);
    21912189}
    21922190
     
    23482346    {
    23492347        g_completedRC = rc;
    2350         memcpy(g_completedBuf, pv, cb);
     2348        if (cb != 0)
     2349            memcpy(g_completedBuf, pv, cb);
    23512350    }
    23522351    else
  • trunk/src/VBox/HostServices/SharedClipboard/x11-clipboard.cpp

    r69500 r69656  
    260260                                    CLIPREADCBREQ *pReq, void *pv, uint32_t cb)
    261261{
    262     if (cb <= pReq->cb)
     262    if (cb <= pReq->cb && cb != 0)
    263263        memcpy(pReq->pv, pv, cb);
    264264    RTMemFree(pReq);
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