VirtualBox

Changeset 40417 in vbox for trunk


Ignore:
Timestamp:
Mar 9, 2012 9:55:31 PM (13 years ago)
Author:
vboxsync
Message:

RTCString::count(): Don't crash if the string is empty (m_psz == NULL).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/string/ministring.cpp

    r39903 r40417  
    235235    size_t      c   = 0;
    236236    const char *psz = m_psz;
    237     char        chCur;
    238     while ((chCur = *psz++) != '\0')
    239         if (chCur == ch)
    240             c++;
     237    if (psz)
     238    {
     239        char    chCur;
     240        while ((chCur = *psz++) != '\0')
     241            if (chCur == ch)
     242                c++;
     243    }
    241244    return c;
    242245}
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