<?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>135040</bug_id>
          
          <creation_ts>2014-07-17 23:11:24 -0700</creation_ts>
          <short_desc>inserting an SVGLength that is already in an SVGAnimatedLengthList::animVal into another list causes a crash</short_desc>
          <delta_ts>2019-05-06 12:40:15 -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>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>191237</dup_id>
          
          <bug_file_loc>http://mcc.id.au/temp/list4.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Cameron McCormack (:heycam)">heycam</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>krit</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>zimmermann</cc>
    
    <cc>zoltan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1023209</commentid>
    <comment_count>0</comment_count>
    <who name="Cameron McCormack (:heycam)">heycam</who>
    <bug_when>2014-07-17 23:11:24 -0700</bug_when>
    <thetext>STR:

1. Load the URL.
2. Crash.

Attempting to insert an SVGLength that came from an SVGAnimatedLengthList&apos;s animVal into another SVGLengthList will cause a crash.  I haven&apos;t looked to see if the crash is serious.  Tested with Safari 7.0.5 (9537.77.4).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023496</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-07-19 22:32:54 -0700</bug_when>
    <thetext>This crash is a null dereference; I doubt there is any security implication, and I suspect this is mis-categorized as a security bug.

The bug seems to be in code in SVGListPropertyTearOff::processIncomingListItemWrapper, which calls SVGAnimatedListPropertyTearOff::findItem, which can’t handle an m_baseVal of nullptr. If I knew this code better, I might suggest fixing this by calling baseVal() inside findItem and in removeItemFromList rather than accessing m_baseVal directly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023504</commentid>
    <comment_count>2</comment_count>
    <who name="Dirk Schulze">krit</who>
    <bug_when>2014-07-19 23:23:34 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; This crash is a null dereference; I doubt there is any security implication, and I suspect this is mis-categorized as a security bug.
&gt; 
&gt; The bug seems to be in code in SVGListPropertyTearOff::processIncomingListItemWrapper, which calls SVGAnimatedListPropertyTearOff::findItem, which can’t handle an m_baseVal of nullptr. If I knew this code better, I might suggest fixing this by calling baseVal() inside findItem and in removeItemFromList rather than accessing m_baseVal directly.

I asked Cameron to open it as security bug since I couldn&apos;t test it myself yet. If you have evidence that it is a normal crash, please re-categorize it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023507</commentid>
    <comment_count>3</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-07-19 23:30:21 -0700</bug_when>
    <thetext>OK, done.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023508</commentid>
    <comment_count>4</comment_count>
      <attachid>235179</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-07-19 23:31:03 -0700</bug_when>
    <thetext>Created attachment 235179
local copy of test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1023509</commentid>
    <comment_count>5</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2014-07-19 23:31:29 -0700</bug_when>
    <thetext>Crashes after trying to access a data member of m_baseVal, which is nullptr.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1053976</commentid>
    <comment_count>6</comment_count>
    <who name="Zoltan Horvath">zoltan</who>
    <bug_when>2014-12-09 16:00:17 -0800</bug_when>
    <thetext>Blink doesn&apos;t have the issue, probably because of some refactoring on this code. Merge candidate tracked in: https://bugs.webkit.org/show_bug.cgi?id=125888</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1533485</commentid>
    <comment_count>7</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2019-05-06 12:40:15 -0700</bug_when>
    <thetext>After https://bugs.webkit.org/show_bug.cgi?id=191237 is fixed and when opening the attached test case in WebKit, I get the following output:

appending an SVG item that is in an animVal list of another element:
  - animVal list item remained the same object
  - an item was appended
  - the appended item was a copy of the animVal list item

This is complies with SVG 2 specs: https://www.w3.org/TR/SVG2/types.html#__svg__SVGNameList__appendItem. Also this is the behavior of FireFox.

*** This bug has been marked as a duplicate of bug 191237 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>235179</attachid>
            <date>2014-07-19 23:31:03 -0700</date>
            <delta_ts>2014-07-19 23:31:03 -0700</delta_ts>
            <desc>local copy of test case</desc>
            <filename>list4.html</filename>
            <type>text/html</type>
            <size>1311</size>
            <attacher name="Darin Adler">darin</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxzdHlsZT4KcHJlIHsgd2hpdGUtc3BhY2U6IHByZTsgfQo8L3N0eWxl
Pgo8cHJlPjwvcHJlPgo8c2NyaXB0PgpmdW5jdGlvbiBzYXkoYU1lc3NhZ2UpIHsKICBkb2N1bWVu
dC5xdWVyeVNlbGVjdG9yKCJwcmUiKS50ZXh0Q29udGVudCArPSBhTWVzc2FnZSArICJcbiI7Cn0K
CnZhciB0ZXh0MSA9IGRvY3VtZW50LmNyZWF0ZUVsZW1lbnROUygiaHR0cDovL3d3dy53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