VirtualBox

Ignore:
Timestamp:
Oct 17, 2016 10:38:53 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
111315
Message:

VBoxTray,InstallerHelper,VBoxService: Use RTLOCALIPC_FLAGS_NATIVE_NAME and format the pipe name into buffers of the exact same size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo-win.cpp

    r64291 r64292  
    3434#include <iprt/mem.h>
    3535#include <iprt/once.h>
     36#include <iprt/process.h>
    3637#include <iprt/string.h>
    3738#include <iprt/semaphore.h>
     
    954955    /* pszDomain is optional. */
    955956
    956     int rc = VINF_SUCCESS;
    957 
    958     char szPipeName[255];
    959 /** @todo r=bird:  Pointless if.  */
    960     if (RTStrPrintf(szPipeName, sizeof(szPipeName), "%s%s", VBOXTRAY_IPC_PIPE_PREFIX, pszUser))
     957    char szPipeName[512 + sizeof(VBOXTRAY_IPC_PIPE_PREFIX)];
     958    memcpy(szPipeName, VBOXTRAY_IPC_PIPE_PREFIX, sizeof(VBOXTRAY_IPC_PIPE_PREFIX));
     959    int rc = RTStrCat(szPipeName, sizeof(szPipeName), pszUser);
     960    if (RT_SUCCESS(rc))
    961961    {
    962962        bool fReportToHost = false;
     
    964964
    965965        RTLOCALIPCSESSION hSession;
    966         rc = RTLocalIpcSessionConnect(&hSession, szPipeName, 0 /* Flags */);
     966        rc = RTLocalIpcSessionConnect(&hSession, szPipeName, RTLOCALIPC_FLAGS_NATIVE_NAME);
    967967        if (RT_SUCCESS(rc))
    968968        {
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