RESOLVED FIXED 226640
FileReader.readAsArrayBuffer misses checking for the type of blob param
https://bugs.webkit.org/show_bug.cgi?id=226640
Summary FileReader.readAsArrayBuffer misses checking for the type of blob param
zyscoder@gmail.com
Reported 2021-06-04 05:12:55 PDT
Steps to reproduce: (1) Open a tab and navigate to any URL; (2) Run the following code in the Console of Devtools: ``` new FileReader().readAsArrayBuffer(undefined); ``` (3) Then this code would be evaluated successfully without throwing any exception. Actual results: This code is evaluated successfully without throwing any exception. Expected results: FileReader.readAsArrayBuffer asks a Blob type object as its parameter, but Webkit doesn't check the type of the param in this code. A TypeError should be thrown in this code. BTW, both Chrome and Firefox throw exceptions: Chrome: `VM1217:1 Uncaught TypeError: Failed to execute 'readAsArrayBuffer' on 'FileReader': parameter 1 is not of type 'Blob'.` Firefox: `Uncaught TypeError: FileReader.readAsArrayBuffer: Argument 1 is not an object.`
Attachments
WIP Patch (4.50 KB, patch)
2021-06-16 11:07 PDT, Chris Dumez
no flags
Patch (10.02 KB, patch)
2021-06-16 12:01 PDT, Chris Dumez
no flags
Michael Catanzaro
Comment 1 2021-06-04 06:49:54 PDT
Hi, please don't use the WebKitGTK component for these general web content bugs. It's for known or suspected platform-specific issues only. You can use the Hardware field to indicate that you're using Linux.
Radar WebKit Bug Importer
Comment 2 2021-06-11 05:13:18 PDT
Chris Dumez
Comment 3 2021-06-16 11:07:48 PDT
Created attachment 431567 [details] WIP Patch
Chris Dumez
Comment 4 2021-06-16 12:01:19 PDT
youenn fablet
Comment 5 2021-06-16 12:25:32 PDT
Comment on attachment 431583 [details] Patch Strange that we do not have any WPT test
Chris Dumez
Comment 6 2021-06-16 12:43:57 PDT
(In reply to youenn fablet from comment #5) > Comment on attachment 431583 [details] > Patch > > Strange that we do not have any WPT test Indeed. I'll resync the WPT tests in a follow-up as we seem a bit out of sync.
EWS
Comment 7 2021-06-16 12:58:39 PDT
Committed r278951 (238880@main): <https://commits.webkit.org/238880@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 431583 [details].
Note You need to log in before you can comment on or make changes to this bug.