VirtualBox

Changeset 93201 in vbox


Ignore:
Timestamp:
Jan 12, 2022 3:17:28 PM (3 years ago)
Author:
vboxsync
Message:

Additions/VbglR3: Use RTStrCopy() in VbglR3HGCMConnect().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/lib/VBoxGuestR3LibHGCM.cpp

    r93115 r93201  
    4545VBGLR3DECL(int) VbglR3HGCMConnect(const char *pszServiceName, HGCMCLIENTID *pidClient)
    4646{
     47    AssertPtrReturn(pszServiceName, VERR_INVALID_POINTER);
     48    AssertPtrReturn(pidClient,      VERR_INVALID_POINTER);
     49
    4750    VBGLIOCHGCMCONNECT Info;
    4851    RT_ZERO(Info);
    4952    VBGLREQHDR_INIT(&Info.Hdr, HGCM_CONNECT);
    5053    Info.u.In.Loc.type = VMMDevHGCMLoc_LocalHost_Existing;
    51     strcpy(Info.u.In.Loc.u.host.achName, pszServiceName);
    52 
    53     int rc = vbglR3DoIOCtl(VBGL_IOCTL_HGCM_CONNECT, &Info.Hdr, sizeof(Info));
     54    int rc = RTStrCopy(Info.u.In.Loc.u.host.achName, sizeof(Info.u.In.Loc.u.host.achName), pszServiceName);
     55    if (RT_FAILURE(rc))
     56        return rc;
     57    rc = vbglR3DoIOCtl(VBGL_IOCTL_HGCM_CONNECT, &Info.Hdr, sizeof(Info));
    5458    if (RT_SUCCESS(rc))
    5559        *pidClient = Info.u.Out.idClient;
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