VirtualBox

Changeset 41167 in vbox


Ignore:
Timestamp:
May 4, 2012 1:33:33 PM (13 years ago)
Author:
vboxsync
Message:

Runtime/uniread: first check the range, then access the array

File:
1 edited

Legend:

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

    r33560 r41167  
    10771077        /* figure how far off the next chunk is */
    10781078        unsigned iSameCase = i;
    1079         while (     g_aCPInfo[iSameCase].SimpleUpperCaseMapping == g_aCPInfo[iSameCase].CodePoint
    1080                &&   iSameCase < RT_ELEMENTS(g_aCPInfo)
     1079        while (     iSameCase < RT_ELEMENTS(g_aCPInfo)
     1080               &&   g_aCPInfo[iSameCase].SimpleUpperCaseMapping == g_aCPInfo[iSameCase].CodePoint
    10811081               &&   iSameCase >= 256)
    10821082            iSameCase++;
     
    11241124        /* figure how far off the next chunk is */
    11251125        unsigned iSameCase = i;
    1126         while (     g_aCPInfo[iSameCase].SimpleLowerCaseMapping == g_aCPInfo[iSameCase].CodePoint
    1127                &&   iSameCase < RT_ELEMENTS(g_aCPInfo)
     1126        while (     iSameCase < RT_ELEMENTS(g_aCPInfo)
     1127               &&   g_aCPInfo[iSameCase].SimpleLowerCaseMapping == g_aCPInfo[iSameCase].CodePoint
    11281128               &&   iSameCase >= 256)
    11291129            iSameCase++;
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