VirtualBox

Changeset 4104 in vbox for trunk


Ignore:
Timestamp:
Aug 10, 2007 7:05:20 AM (17 years ago)
Author:
vboxsync
Message:

Runtime/RTEnv: Fixed the off by one bug.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/env-generic.cpp

    r4101 r4104  
    143143    struct RTENVINTERNAL *pIntEnv;
    144144
    145     int rc = rtEnvCreate(&pIntEnv, cEnv);
     145    int rc = rtEnvCreate(&pIntEnv, cEnv + 1 /* NULL */);
    146146    if (RT_FAILURE(rc))
    147147        return rc;
     
    207207    int rc;
    208208
    209     size_t cCapacity = (pIntEnv->cCount + cVars + RTENV_GROW_SIZE - 1)
     209    size_t cCapacity = (pIntEnv->cCount + cVars + 1 /* NULL */ + RTENV_GROW_SIZE - 1)
    210210                       / RTENV_GROW_SIZE * RTENV_GROW_SIZE;
    211211    bool needAlloc = cCapacity != pIntEnv->cCapacity;
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