<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>17771</bug_id>
          
          <creation_ts>2008-03-11 09:34:34 -0700</creation_ts>
          <short_desc>SVGImage accesses m_frame w/o checking for NULL</short_desc>
          <delta_ts>2008-03-18 16:51:53 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.trilulilu.ro/audio/cele-mai-recente/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>NeedsReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Eric Seidel (no email)">eric</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73328</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-03-11 09:34:34 -0700</bug_when>
    <thetext>SVGImage accesses m_frame w/o checking for NULL

I don&apos;t know how to get real crashlogs out of this machine (I&apos;m on windows for the moment).  But the top of the stack was something like this:

Frame::document()
SVGImage::hasRelativeWidth()
RenderImage::calcReplacedWidth()
RenderImage::calcPrefWidths()
RenderBox::minPrefWidth()

Looking at SVGImage.cpp it&apos;s clear we have many instances of un-guarded usage of m_frame.  I&apos;m sure there are other crashes like this to be found.

We&apos;ll need to create a reduction (by staring @ the SVGImage source code)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73660</commentid>
    <comment_count>1</comment_count>
      <attachid>19753</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-03-13 20:23:21 -0700</bug_when>
    <thetext>Created attachment 19753
Fix crash

 WebCore/svg/graphics/SVGImage.cpp |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73661</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-03-13 20:29:24 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Created an attachment (id=19753) [edit]
&gt; Fix crash
&gt; 
&gt;  WebCore/svg/graphics/SVGImage.cpp |    8 ++++++++
&gt;  1 files changed, 8 insertions(+), 0 deletions(-)
&gt; 

I failed to figure out how to make a test case for this.  I&apos;ve only seen this crash once, but the code definitely looks wrong.  I expect this happens when the SVGImage not yet done loading, and is asked to layout.  I tried using an empty SVGImage, but that just produced an error icon.  I also tried creating an http test, but wasn&apos;t successful.  Perhaps someone with some http test foo would like to guide me through such a process.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73662</commentid>
    <comment_count>3</comment_count>
      <attachid>19753</attachid>
    <who name="Oliver Hunt">oliver</who>
    <bug_when>2008-03-13 20:39:59 -0700</bug_when>
    <thetext>Comment on attachment 19753
Fix crash

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73960</commentid>
    <comment_count>4</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2008-03-16 13:20:58 -0700</bug_when>
    <thetext>Assigning to Eric, assuming he&apos;s going to land his own patch.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>74354</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-03-18 16:51:53 -0700</bug_when>
    <thetext>Landed as:
http://trac.webkit.org/projects/webkit/changeset/31139

I was very sad that I was not able to create a test case for this.  I&apos;m certain there are ways to make the old code crash.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>19753</attachid>
            <date>2008-03-13 20:23:21 -0700</date>
            <delta_ts>2008-03-13 20:39:59 -0700</delta_ts>
            <desc>Fix crash</desc>
            <filename>Fix-crash.patch</filename>
            <type>text/plain</type>
            <size>1556</size>
            <attacher name="Eric Seidel (no email)">eric</attacher>
            
              <data encoding="base64">MGJhZDA3MTU0MDI1YjVhYTc5Njg3MDI5YjZlYWIxZjkxYTc3MTMzNwpkaWZmIC0tZ2l0IGEvV2Vi
Q29yZS9zdmcvZ3JhcGhpY3MvU1ZHSW1hZ2UuY3BwIGIvV2ViQ29yZS9zdmcvZ3JhcGhpY3MvU1ZH
SW1hZ2UuY3BwCmluZGV4IDcyM2FiODIuLjk4NGI4MzIgMTAwNjQ0Ci0tLSBhL1dlYkNvcmUvc3Zn
L2dyYXBoaWNzL1NWR0ltYWdlLmNwcAorKysgYi9XZWJDb3JlL3N2Zy9ncmFwaGljcy9TVkdJbWFn
ZS5jcHAKQEAgLTcwLDYgKzcwLDggQEAgdm9pZCBTVkdJbWFnZTo6c2V0Q29udGFpbmVyU2l6ZShj
b25zdCBJbnRTaXplJiBjb250YWluZXJTaXplKQogICAgIGlmIChjb250YWluZXJTaXplLndpZHRo
KCkgPD0gMCB8fCBjb250YWluZXJTaXplLmhlaWdodCgpIDw9IDApCiAgICAgICAgIHJldHVybjsK
IAorICAgIGlmICghbV9mcmFtZSB8fCAhbV9mcmFtZS0+ZG9jdW1lbnQoKSkKKyAgICAgICAgcmV0
dXJuOwogICAgIFNWR1NWR0VsZW1lbnQqIHJvb3RFbGVtZW50ID0gc3RhdGljX2Nhc3Q8U1ZHRG9j
dW1lbnQqPihtX2ZyYW1lLT5kb2N1bWVudCgpKS0+cm9vdEVsZW1lbnQoKTsKICAgICBpZiAoIXJv
b3RFbGVtZW50KQogICAgICAgIC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RvY3VtZW50KCkpCisgICAgICAgIHJldHVybiBmYWxzZTsKICAgICBTVkdTVkdF
bGVtZW50KiByb290RWxlbWVudCA9IHN0YXRpY19jYXN0PFNWR0RvY3VtZW50Kj4obV9mcmFtZS0+
ZG9jdW1lbnQoKSktPnJvb3RFbGVtZW50KCk7CiAgICAgaWYgKCFyb290RWxlbWVudCkKICAgICAg
ICAgcmV0dXJuIGZhbHNlOwo=
</data>
<flag name="review"
          id="8648"
          type_id="1"
          status="+"
          setter="oliver"
    />
          </attachment>
      

    </bug>

</bugzilla>