VirtualBox

Ignore:
Timestamp:
Apr 20, 2012 1:47:13 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77571
Message:

SharedFolders: fixed read beyond buffer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedFolders/mappings.cpp

    r39643 r41013  
    430430    if (pFolderMapping->fValid == true)
    431431    {
    432         pString->u16Length = pFolderMapping->pMapName->u16Length;
    433         memcpy(pString->String.ucs2, pFolderMapping->pMapName->String.ucs2, pString->u16Size);
     432        if (pString->u16Size < pFolderMapping->pMapName->u16Size)
     433        {
     434            Log(("vbsfMappingsQuery: passed string too short (%d < %d bytes)!\n",
     435                pString->u16Size,  pFolderMapping->pMapName->u16Size));
     436            rc = VERR_INVALID_PARAMETER;
     437        }
     438        else
     439        {
     440            pString->u16Length = pFolderMapping->pMapName->u16Length;
     441            memcpy(pString->String.ucs2, pFolderMapping->pMapName->String.ucs2,
     442                   pFolderMapping->pMapName->u16Size);
     443        }
    434444    }
    435445    else
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