VirtualBox

Ignore:
Timestamp:
Apr 27, 2009 3:54:13 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
46589
Message:

SharedClipboard/x11: fix a potential crash if a zero-length compound text string is read

File:
1 edited

Legend:

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

    r19219 r19220  
    320320                   cbSrcLen, cb, cbSrcLen, reinterpret_cast<char *>(pValue)));
    321321    *pcbActual = 0;  /* Only set this to the right value on success. */
     322    /** @todo quick fix for 2.2, do this properly. */
     323    if (cbSrcLen == 0)
     324    {
     325        XtFree(reinterpret_cast<char *>(pValue));
     326        if (cb < 2)
     327            return VERR_BUFFER_OVERFLOW;
     328        *(PRTUTF16) pv = 0;
     329        *pcbActual = 2;
     330        return VINF_SUCCESS;
     331    }
    322332    /* First convert the compound text to Utf8 */
    323333    property.value = reinterpret_cast<unsigned char *>(pValue);
Note: See TracChangeset for help on using the changeset viewer.

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