<?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>20295</bug_id>
          
          <creation_ts>2008-08-06 03:44:21 -0700</creation_ts>
          <short_desc>RegularExpression::match should not crash when a null string is passed</short_desc>
          <delta_ts>2008-08-08 02:32:24 -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>Text</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></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="Marco Barisione">marco.barisione</reporter>
          <assigned_to name="Marco Barisione">marco.barisione</assigned_to>
          <cc>alp</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>87934</commentid>
    <comment_count>0</comment_count>
    <who name="Marco Barisione">marco.barisione</who>
    <bug_when>2008-08-06 03:44:21 -0700</bug_when>
    <thetext>RegularExpression::match() passes a null subject string to jsRegExpExecute causing a crash.

See also bug #19794 for a discussion on this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87936</commentid>
    <comment_count>1</comment_count>
      <attachid>22675</attachid>
    <who name="Marco Barisione">marco.barisione</who>
    <bug_when>2008-08-06 03:54:59 -0700</bug_when>
    <thetext>Created attachment 22675
Check for null strings</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87946</commentid>
    <comment_count>2</comment_count>
      <attachid>22675</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-08-06 05:22:20 -0700</bug_when>
    <thetext>Comment on attachment 22675
Check for null strings

I found the text &quot;...  with the null string.&quot; a bit confusing.  I think that last clause could be removed.   Looks great!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87950</commentid>
    <comment_count>3</comment_count>
    <who name="Jan Alonzo">jmalonzo</who>
    <bug_when>2008-08-06 05:47:17 -0700</bug_when>
    <thetext>Removed the last clause before landing. Landed in r35601</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87957</commentid>
    <comment_count>4</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-08-06 07:30:01 -0700</bug_when>
    <thetext>How was this being hit? Is it possible to make a test case? In previous occurrences of this crash, the fix was applied at the call site.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87959</commentid>
    <comment_count>5</comment_count>
    <who name="Marco Barisione">marco.barisione</who>
    <bug_when>2008-08-06 07:40:58 -0700</bug_when>
    <thetext>(In reply to comment #4)
&gt; How was this being hit? Is it possible to make a test case? In previous
&gt; occurrences of this crash, the fix was applied at the call site.

RegularExpression::match is called by DOMImplementation::isXMLMIMEType. Of course the mime type should not be null, this is why I&apos;m also proposing to commit patch #22023 to the CURL backend but IMHO it&apos;s a good idea to protect RegularExpression::match from crashing.
If you think that this is not the best idea we could just throw away this patch or I could write a patch to check for null mime types in DOMImplementation::isXMLMIMEType.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88094</commentid>
    <comment_count>6</comment_count>
    <who name="Alp Toker">alp</who>
    <bug_when>2008-08-08 01:30:28 -0700</bug_when>
    <thetext>Does a two-line null check need a whole new copyright entry?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88096</commentid>
    <comment_count>7</comment_count>
    <who name="Marco Barisione">marco.barisione</who>
    <bug_when>2008-08-08 02:32:24 -0700</bug_when>
    <thetext>(In reply to comment #6)
&gt; Does a two-line null check need a whole new copyright entry?

Actually no, I just did that out of habit.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>22675</attachid>
            <date>2008-08-06 03:54:59 -0700</date>
            <delta_ts>2008-08-06 05:22:20 -0700</delta_ts>
            <desc>Check for null strings</desc>
            <filename>match-null.patch</filename>
            <type>text/plain</type>
            <size>1822</size>
            <attacher name="Marco Barisione">marco.barisione</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
ZDI2YjZiOC4uYWU2ZjNmZCAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxOSBAQAorMjAwOC0wOC0wNiAgTWFyY28gQmFyaXNp
b25lICA8bWFyY28uYmFyaXNpb25lQGNvbGxhYm9yYS5jby51az4KKworICAgICAgICBSZXZpZXdl
ZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBodHRwOi8vYnVncy53ZWJraXQub3JnL3No
b3dfYnVnLmNnaT9pZD0yMDI5NQorICAgICAgICBSZWd1bGFyRXhwcmVzc2lvbjo6bWF0Y2ggc2hv
dWxkIG5vdCBjcmFzaCB3aGVuIGEgbnVsbCBzdHJpbmcgaXMgcGFzc2VkCisKKyAgICAgICAgUmVn
dWxhckV4cHJlc3Npb246Om1hdGNoIHVzZWQgdG8gcGFzcyBudWxsIHN1YmplY3Qgc3RyaW5ncyB0
bworICAgICAgICBqc1JlZ0V4cEV4ZWN1dGUgY2F1c2luZyBhbiBBU1NFUlQgZmFpbHVyZSBhbmQg
dGhlbiBhIGNyYXNoLgorICAgICAgICBUaGVyZSBpcyBubyBuZWVkIHRvIGZpeCBhbHNvIFJlZ3Vs
YXJFeHByZXNzaW9uOnNlYXJjaCBhbmQKKyAgICAgICAgUmVndWxhck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UgZm9sbG93aW5nIGNvbmRpdGlvbnMKQEAgLTEy
OSw2ICsxMzAsOSBAQCBTdHJpbmcgUmVndWxhckV4cHJlc3Npb246OnBhdHRlcm4oKSBjb25zdAog
CiBpbnQgUmVndWxhckV4cHJlc3Npb246Om1hdGNoKGNvbnN0IFN0cmluZyYgc3RyLCBpbnQgc3Rh
cnRGcm9tLCBpbnQqIG1hdGNoTGVuZ3RoKSBjb25zdAogeworICAgIGlmIChzdHIuaXNOdWxsKCkp
CisgICAgICAgIHJldHVybiAtMTsKKwogICAgIGQtPmxhc3RNYXRjaFN0cmluZyA9IHN0cjsKICAg
ICAvLyBGaXJzdCAyIG9mZnNldHMgYXJlIHN0YXJ0IGFuZCBlbmQgb2Zmc2V0czsgM3JkIGVudHJ5
IGlzIHVzZWQgaW50ZXJuYWxseSBieSBwY3JlCiAgICAgZC0+bGFzdE1hdGNoQ291bnQgPSBqc1Jl
Z0V4cEV4ZWN1dGUoZC0+cmVnZXgsIGQtPmxhc3RNYXRjaFN0cmluZy5jaGFyYWN0ZXJzKCksCg==
</data>
<flag name="review"
          id="10044"
          type_id="1"
          status="+"
          setter="eric"
    />
          </attachment>
      

    </bug>

</bugzilla>