Bug 79715 - FileReader crashes when file is not readable
Summary: FileReader crashes when file is not readable
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexey Proskuryakov
Depends on:
Reported: 2012-02-27 16:38 PST by Alexey Proskuryakov
Modified: 2012-02-28 11:50 PST (History)
3 users (show)

See Also:

poposed fix (4.18 KB, patch)
2012-02-27 17:31 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff
patch with test (6.88 KB, patch)
2012-02-28 10:43 PST, Alexey Proskuryakov
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.