Changeset 44865 in webkit for trunk


Ignore:
Timestamp:
Jun 19, 2009 12:54:57 PM (15 years ago)
Author:
bfulgham@webkit.org
Message:

2009-06-19 Chris Evans <scarybeasts@gmail.com>

Reviewed by Eric Seidel.

There is no new test because this cannot be tested deterministically.
I've not been able to cause a crash at all in the test framework, but
I have verified that this is happening in the wild and that the patch
fixes the likely cause in the debugger.

  • loader/TextResourceDecoder.cpp: careful not to iterate off the end of our input buffer looking for the end of the comment.
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r44861 r44865  
     12009-06-19  Chris Evans  <scarybeasts@gmail.com>
     2
     3        Reviewed by Eric Seidel.
     4
     5        There is no new test because this cannot be tested deterministically.
     6        I've not been able to cause a crash at all in the test framework, but
     7        I have verified that this is happening in the wild and that the patch
     8        fixes the likely cause in the debugger.
     9
     10        * loader/TextResourceDecoder.cpp: careful not to iterate off the end
     11          of our input buffer looking for the end of the comment.
     12
    1132009-06-19  Adam Barth  <abarth@webkit.org>
    214
  • trunk/WebCore/loader/TextResourceDecoder.cpp

    r42022 r44865  
    510510{
    511511    const char* p = ptr;
     512    if (p == pEnd)
     513      return;
    512514    // Allow <!-->; other browsers do.
    513515    if (*p == '>') {
    514516        p++;
    515517    } else {
    516         while (p != pEnd) {
     518        while (p + 2 < pEnd) {
    517519            if (*p == '-') {
    518520                // This is the real end of comment, "-->".
     
    522524                }
    523525                // This is the incorrect end of comment that other browsers allow, "--!>".
    524                 if (p[1] == '-' && p[2] == '!' && p[3] == '>') {
     526                if (p + 3 < pEnd && p[1] == '-' && p[2] == '!' && p[3] == '>') {
    525527                    p += 4;
    526528                    break;
Note: See TracChangeset for help on using the changeset viewer.