Changeset 138994 in webkit


Ignore:
Timestamp:
Jan 7, 2013, 2:56:02 PM (12 years ago)
Author:
junov@google.com
Message:

Fixing memory read after free in CanvasRenderingContext2D::accessFont
https://bugs.webkit.org/show_bug.cgi?id=106244

Reviewed by Abhishek Arya.

Source/WebCore:

Using a temporary String object to hold ref count on string that is
passed by reference in CanvasRenderingContext2D::accessFont.

Test: fast/canvas/canvas-measureText.html

  • html/canvas/CanvasRenderingContext2D.cpp:

(WebCore::CanvasRenderingContext2D::accessFont):

LayoutTests:

New test case to verify stability of 2D canvas method measureText.
Test case was causing a DumpRenderTree crash on builds with
AddressSantitizer instrumentation.

  • fast/canvas/canvas-measureText-expected.txt: Added.
  • fast/canvas/canvas-measureText.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r138988 r138994  
     12013-01-07  Justin Novosad  <junov@google.com>
     2
     3        Fixing memory read after free in CanvasRenderingContext2D::accessFont
     4        https://bugs.webkit.org/show_bug.cgi?id=106244
     5
     6        Reviewed by Abhishek Arya.
     7
     8        New test case to verify stability of 2D canvas method measureText.
     9        Test case was causing a DumpRenderTree crash on builds with
     10        AddressSantitizer instrumentation.
     11
     12        * fast/canvas/canvas-measureText-expected.txt: Added.
     13        * fast/canvas/canvas-measureText.html: Added.
     14
    1152013-01-07  Abhishek Arya  <inferno@chromium.org>
    216
  • trunk/Source/WebCore/ChangeLog

    r138992 r138994  
     12013-01-07  Justin Novosad  <junov@google.com>
     2
     3        Fixing memory read after free in CanvasRenderingContext2D::accessFont
     4        https://bugs.webkit.org/show_bug.cgi?id=106244
     5
     6        Reviewed by Abhishek Arya.
     7
     8        Using a temporary String object to hold ref count on string that is
     9        passed by reference in CanvasRenderingContext2D::accessFont.
     10
     11        Test: fast/canvas/canvas-measureText.html
     12
     13        * html/canvas/CanvasRenderingContext2D.cpp:
     14        (WebCore::CanvasRenderingContext2D::accessFont):
     15
    1162013-01-07  Anders Carlsson  <andersca@apple.com>
    217
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r138334 r138994  
    23742374    canvas()->document()->updateStyleIfNeeded();
    23752375
    2376     if (!state().m_realizedFont)
    2377         setFont(state().m_unparsedFont);
     2376    if (!state().m_realizedFont) {
     2377        // Create temporary string object to hold ref count in case
     2378        // state().m_unparsedFont in unreffed by call to realizeSaves in
     2379        // setFont.
     2380        String unparsedFont(state().m_unparsedFont);
     2381        setFont(unparsedFont);
     2382    }
    23782383    return state().m_font;
    23792384}
Note: See TracChangeset for help on using the changeset viewer.