Bug 79715

Summary: FileReader crashes when file is not readable
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: WebCore Misc.Assignee: Alexey Proskuryakov <ap>
Severity: Normal CC: dimich, jianli, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
poposed fix
patch with test none

Description Alexey Proskuryakov 2012-02-27 16:38:50 PST
E.g. if there's no permission, or it's a directory.
Comment 1 Alexey Proskuryakov 2012-02-27 17:31:04 PST
Created attachment 129145 [details]
poposed fix
Comment 2 Jian Li 2012-02-27 17:36:47 PST
Thanks for catching and fixing this. Is it possible to add a test for this?
Comment 3 Alexey Proskuryakov 2012-02-27 17:38:30 PST
I don't see how to add a test. I don't think that there is an unreadable file to count on.
Comment 4 Jian Li 2012-02-27 18:08:12 PST
We can pass a directory to eventSender.beginDragWithFiles.

To test the case that there's no permission, it will require quite a bit of work. We can have a perl/python script to create a temporary file, revoke its read permission and then pass it to eventSender.beginDragWithFiles (see send-sliced-dragged-file.js that uses this technique to modify the temp file). How do you think?
Comment 5 Alexey Proskuryakov 2012-02-28 10:43:12 PST
Created attachment 129289 [details]
patch with test

Good idea.
Comment 6 WebKit Review Bot 2012-02-28 11:50:12 PST
Comment on attachment 129289 [details]
patch with test

Clearing flags on attachment: 129289

Committed r109132: <http://trac.webkit.org/changeset/109132>
Comment 7 WebKit Review Bot 2012-02-28 11:50:16 PST
All reviewed patches have been landed.  Closing bug.