VirtualBox

Changeset 58232 in vbox


Ignore:
Timestamp:
Oct 14, 2015 12:03:29 PM (9 years ago)
Author:
vboxsync
Message:

DnD: More validation.

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/GuestDnDPrivate.h

    r58230 r58232  
    596596            return VINF_SUCCESS;
    597597        }
     598
     599        if (!RTStrIsValidEncoding(pszList))
     600            return VERR_INVALID_PARAMETER;
    598601
    599602        RTCList<RTCString> lstURIOrg = RTCString(pszList, cbList).split("\r\n");
  • trunk/src/VBox/Main/src-client/GuestDnDPrivate.cpp

    r58230 r58232  
    388388            AssertReturn(DragAndDropSvc::CB_MAGIC_DND_HG_REQ_DATA == pCBData->hdr.u32Magic, VERR_INVALID_PARAMETER);
    389389
    390             if (   pCBData->cbFormat == 0
    391                 || pCBData->cbFormat > _64K) /** @todo Make this configurable? */
     390            if (   pCBData->cbFormat  == 0
     391                || pCBData->cbFormat  > _64K /** @todo Make this configurable? */
     392                || pCBData->pszFormat == NULL)
     393            {
     394                rc = VERR_INVALID_PARAMETER;
     395            }
     396            else if (!RTStrIsValidEncoding(pCBData->pszFormat))
    392397            {
    393398                rc = VERR_INVALID_PARAMETER;
     
    427432            AssertReturn(DragAndDropSvc::CB_MAGIC_DND_GH_ACK_PENDING == pCBData->hdr.u32Magic, VERR_INVALID_PARAMETER);
    428433
    429             if (   pCBData->cbFormat == 0
    430                 || pCBData->cbFormat > _64K) /** @todo Make the maximum size configurable? */
     434            if (   pCBData->cbFormat  == 0
     435                || pCBData->cbFormat  > _64K /** @todo Make the maximum size configurable? */
     436                || pCBData->pszFormat == NULL)
     437            {
     438                rc = VERR_INVALID_PARAMETER;
     439            }
     440            else if (!RTStrIsValidEncoding(pCBData->pszFormat))
    431441            {
    432442                rc = VERR_INVALID_PARAMETER;
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