⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 107369 in webkit


Ignore:
Timestamp:
Feb 9, 2012, 11:49:35 PM (15 years ago)
Author:
zherczeg@webkit.org
Message:

Heap-buffer-overflow in WebCore::CSSParser::lex
https://bugs.webkit.org/show_bug.cgi?id=77402

Reviewed by Antti Koivisto.

Source/WebCore:

Comments should check only a single \0 terminator.

Test: fast/css/parsing-css-comment.html

  • css/CSSParser.cpp:

(WebCore::CSSParser::lex):

LayoutTests:

Test various comment types.

  • fast/css/parsing-css-comment-expected.txt: Added.
  • fast/css/parsing-css-comment.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r107365 r107369  
     12012-02-09  Zoltan Herczeg  <zherczeg@webkit.org>
     2
     3        Heap-buffer-overflow in WebCore::CSSParser::lex
     4        https://bugs.webkit.org/show_bug.cgi?id=77402
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Test various comment types.
     9
     10        * fast/css/parsing-css-comment-expected.txt: Added.
     11        * fast/css/parsing-css-comment.html: Added.
     12
    1132012-02-09  Kenichi Ishibashi  <bashi@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r107368 r107369  
     12012-02-09  Zoltan Herczeg  <zherczeg@webkit.org>
     2
     3        Heap-buffer-overflow in WebCore::CSSParser::lex
     4        https://bugs.webkit.org/show_bug.cgi?id=77402
     5
     6        Reviewed by Antti Koivisto.
     7
     8        Comments should check only a single \0 terminator.
     9
     10        Test: fast/css/parsing-css-comment.html
     11
     12        * css/CSSParser.cpp:
     13        (WebCore::CSSParser::lex):
     14
    1152012-02-09  Kentaro Hara  <haraken@chromium.org>
    216
  • trunk/Source/WebCore/css/CSSParser.cpp

    r107289 r107369  
    85268526            ++m_currentCharacter;
    85278527            while (m_currentCharacter[0] != '*' || m_currentCharacter[1] != '/') {
    8528                 if (m_currentCharacter[0] == '\n')
     8528                if (*m_currentCharacter == '\n')
    85298529                    ++m_lineNumber;
    8530                 if (m_currentCharacter[0] == '\0' && m_currentCharacter[1] == '\0') {
     8530                if (*m_currentCharacter == '\0') {
    85318531                    // Unterminated comments are simply ignored.
    85328532                    m_currentCharacter -= 2;
Note: See TracChangeset for help on using the changeset viewer.