< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[reSIProcate] memory overrun in MsgHeaderScanner.cxx


Hi, all,

Just found a memory overrun in MsgHeaderScanner.cxx, 

    static CharInfo charInfoArray[UCHAR_MAX];
    
    static void initCharInfoArray()
    {
        for(unsigned int charIndex = 0; charIndex <=
UCHAR_MAX; ++charIndex) 
        {
            charInfoArray[charIndex].category =
ccOther;
            charInfoArray[charIndex].textPropBitMask =
0;
        }

Here, charInfoArray has a size of UCHAR_MAX, but the
charIndex has value of UCHAR_MAX. Should we change it
to static CharInfo charInfoArray[UCHAR_MAX + 1];

Please confirm that.

Many thanks,

kaiduan

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com