VirtualBox

Ignore:
Timestamp:
Mar 10, 2020 5:29:40 PM (5 years ago)
Author:
vboxsync
Message:

IPRT/ministring.cpp: Don't crash in RTCString::endsWith() when running against an empty string.

File:
1 edited

Legend:

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

    r82968 r83252  
    982982    if (l1 < l2)
    983983        return false;
    984     /** @todo r=bird: If l2 is 0, then m_psz can be NULL and we will crash. See
    985      *        also handling of l2 == in startsWith. */
     984
     985    if (!m_psz) /* Don't crash when running against an empty string. */
     986        return false;
     987
     988    /** @todo r=bird: See handling of l2 == in startsWith; inconsistent output (if l2 == 0, it matches anything). */
    986989
    987990    size_t l = l1 - l2;
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