VirtualBox

Ignore:
Timestamp:
Aug 25, 2010 10:09:12 AM (14 years ago)
Author:
vboxsync
Message:

Additions/VBoxService: fixed generation of the environments array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceControlExec.cpp

    r31847 r31951  
    687687            while (cbLen < cbEnv)
    688688            {
    689                 if (RTStrAPrintf(&pData->papszEnv[i++], "%s", pcCur) < 0)
     689                int cbStr = RTStrAPrintf(&pData->papszEnv[i++], "%s", pcCur);
     690                if (cbStr < 0)
    690691                {
    691692                    rc = VERR_NO_MEMORY;
    692693                    break;
    693694                }
    694                 cbLen += strlen(pcCur) + 1; /* Skip terminating zero. */
    695                 pcCur += cbLen;
     695                cbLen += cbStr + 1; /* Skip terminating '\0' */
     696                pcCur += cbStr + 1; /* Skip terminating '\0' */
    696697            }
    697698        }
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