VirtualBox

儲存庫 vbox 的更動 67622


忽略:
時間撮記:
2017-6-26 下午09:16:24 (7 年 以前)
作者:
vboxsync
訊息:

VBoxProxyStub.c: off-by-two

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c

    r66922 r67622  
    23272327    moduleLen = RTUtf16Len(wszServiceModule);
    23282328
    2329     if (dirLen + moduleLen >= MAX_PATH + QUOTES_SPACE ||
    2330         !RT_SUCCESS(RTUtf16Copy(szFilePath + 1, MAX_PATH + QUOTES_SPACE - 1, wszVBoxDir)) ||
    2331         !RT_SUCCESS(RTUtf16Copy(szFilePath + dirLen + 1, MAX_PATH + QUOTES_SPACE - dirLen - 1, wszServiceModule)))
     2329    if (   dirLen + moduleLen + 2 >= MAX_PATH + QUOTES_SPACE
     2330        || !RT_SUCCESS(RTUtf16Copy(szFilePath + 1, MAX_PATH + QUOTES_SPACE - 1, wszVBoxDir))
     2331        || !RT_SUCCESS(RTUtf16Copy(szFilePath + dirLen + 1, MAX_PATH + QUOTES_SPACE - dirLen - 1, wszServiceModule)))
    23322332    {
    23332333        LogWarnFunc(("Error: The path to a windows service module is too long\n"));
     
    23482348    }
    23492349
    2350     hService = CreateService(
    2351         hSCM, wszServiceName, wszServiceDisplayName,
    2352         SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
    2353         SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL,
    2354         szFilePath, NULL, NULL, L"RPCSS\0", NULL, NULL);
    2355 
     2350    hService = CreateService(hSCM, wszServiceName, wszServiceDisplayName,
     2351                             SERVICE_ALL_ACCESS, SERVICE_WIN32_OWN_PROCESS,
     2352                             SERVICE_DEMAND_START, SERVICE_ERROR_NORMAL,
     2353                             szFilePath, NULL, NULL, L"RPCSS\0", NULL, NULL);
    23562354    if (hService == NULL)
    23572355    {
     
    23662364    {
    23672365        LogWarnFunc(("Error: could not set service description. code: %x\n",
    2368             GetLastError()));
     2366                    GetLastError()));
    23692367        Assert(0);
    23702368    }
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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