Changeset 65493 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Aug 17, 2010, 4:54:39 AM (15 years ago)
Author:
[email protected]
Message:

2010-08-17 Yuta Kitamura <[email protected]>

Reviewed by Shinichiro Hamaji.

Avoid uninitialized memory read in StringImpl::find().

REGRESSION(r65468): Crashes in StringImpl::find
https://bugs.webkit.org/show_bug.cgi?id=44099

  • wtf/text/StringImpl.cpp: (WTF::StringImpl::find):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r65479 r65493  
     12010-08-17  Yuta Kitamura  <[email protected]>
     2
     3        Reviewed by Shinichiro Hamaji.
     4
     5        Avoid uninitialized memory read in StringImpl::find().
     6
     7        REGRESSION(r65468): Crashes in StringImpl::find
     8        https://bugs.webkit.org/show_bug.cgi?id=44099
     9
     10        * wtf/text/StringImpl.cpp:
     11        (WTF::StringImpl::find):
     12
    1132010-08-16  Gavin Barraclough  <[email protected]>
    214
  • trunk/JavaScriptCore/wtf/text/StringImpl.cpp

    r65468 r65493  
    543543    }
    544544
    545     for (unsigned i = 0; i <= delta; ++i) {
     545    for (unsigned i = 0; i < delta; ++i) {
    546546        if (searchHash == matchHash && equal(searchCharacters + i, matchString, matchLength))
    547547            return index + i;
     
    549549        searchHash -= searchCharacters[i];
    550550    }
     551    if (searchHash == matchHash && equal(searchCharacters + delta, matchString, matchLength))
     552        return index + delta;
    551553    return notFound;
    552554}
Note: See TracChangeset for help on using the changeset viewer.