<?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>25812</bug_id>
          
          <creation_ts>2009-05-14 16:44:37 -0700</creation_ts>
          <short_desc>Uninitialized varilable referenced while parsing CSS</short_desc>
          <delta_ts>2009-11-24 18:40:31 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>LayoutTests/fast/canvas/canvas-gradient-addStop-error.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Rahul Kuchhal">kuchhal</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mattm</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>121410</commentid>
    <comment_count>0</comment_count>
    <who name="Rahul Kuchhal">kuchhal</who>
    <bug_when>2009-05-14 16:44:37 -0700</bug_when>
    <thetext>Debug Safari while opening LayoutTests/fast/canvas/canvas-gradient-addStop-error.html.

CSSParserValueList::addValue(const CSSParserValue&amp; v) gets called by cssyparse several times:
void CSSParserValueList::addValue(const CSSParserValue&amp; v)
{
    if (v.unit == CSSPrimitiveValue::CSS_PARSER_VARIABLE_FUNCTION_SYNTAX)
        m_variablesCount++;
    m_values.append(v);
}

But looks like in many of these cases v.unit is not really initialized and holds junk value. For example in one instance of such call:

-		v	{id=0 isInt=true fValue=-9.2559592782649444e+061 ...}	const WebCore::CSSParserValue &amp;
		id	0	int
		isInt	true	bool
		fValue	-9.2559592782649444e+061	double
		iValue	58260512	int
+		string	{characters=0x0378fc20 &quot;??&quot; length=-858993460 }	WebCore::CSSParserString
+		function	0x0378fc20 {name={...} args=0x061a0d20 }	WebCore::CSSParserFunction *
		unit	1048577	int

Same problem is in CSSParserValueList::~CSSParserValueList() too. It tries to read unit of all m_values when some of them have junk values for unit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121412</commentid>
    <comment_count>1</comment_count>
    <who name="Dan Kegel">dank</who>
    <bug_when>2009-05-14 17:10:51 -0700</bug_when>
    <thetext>Originally found on Linux, see
http://code.google.com/p/chromium/issues/detail?id=9524,
but probably also on other systems.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121479</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-05-15 02:33:27 -0700</bug_when>
    <thetext>See also: bug 22772.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>166314</commentid>
    <comment_count>3</comment_count>
    <who name="Matt Mueller">mattm</who>
    <bug_when>2009-11-24 17:40:59 -0800</bug_when>
    <thetext>I can&apos;t repro this now, and inspecting the CSSGrammar.y file it appears all &quot;value&quot; rules set the unit member.

I believe it was fixed with http://trac.webkit.org/changeset/44075 (2009-05-22)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>