Bug 20295

Summary: RegularExpression::match should not crash when a null string is passed
Product: WebKit Reporter: Marco Barisione <marco.barisione>
Component: TextAssignee: Marco Barisione <marco.barisione>
Status: RESOLVED FIXED    
Severity: Normal CC: alp, mitz
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Check for null strings eric: review+

Marco Barisione
Reported 2008-08-06 03:44:21 PDT
RegularExpression::match() passes a null subject string to jsRegExpExecute causing a crash. See also bug #19794 for a discussion on this.
Attachments
Check for null strings (1.78 KB, patch)
2008-08-06 03:54 PDT, Marco Barisione
eric: review+
Marco Barisione
Comment 1 2008-08-06 03:54:59 PDT
Created attachment 22675 [details] Check for null strings
Eric Seidel (no email)
Comment 2 2008-08-06 05:22:20 PDT
Comment on attachment 22675 [details] Check for null strings I found the text "... with the null string." a bit confusing. I think that last clause could be removed. Looks great!
Jan Alonzo
Comment 3 2008-08-06 05:47:17 PDT
Removed the last clause before landing. Landed in r35601
mitz
Comment 4 2008-08-06 07:30:01 PDT
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.
Marco Barisione
Comment 5 2008-08-06 07:40:58 PDT
(In reply to comment #4) > 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. RegularExpression::match is called by DOMImplementation::isXMLMIMEType. Of course the mime type should not be null, this is why I'm also proposing to commit patch #22023 to the CURL backend but IMHO it'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.
Alp Toker
Comment 6 2008-08-08 01:30:28 PDT
Does a two-line null check need a whole new copyright entry?
Marco Barisione
Comment 7 2008-08-08 02:32:24 PDT
(In reply to comment #6) > Does a two-line null check need a whole new copyright entry? Actually no, I just did that out of habit.
Note You need to log in before you can comment on or make changes to this bug.