[Webkit-unassigned] [Bug 226640] New: FileReader.readAsArrayBuffer misses checking for the type of blob param

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 4 05:12:55 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=226640

            Bug ID: 226640
           Summary: FileReader.readAsArrayBuffer misses checking for the
                    type of blob param
           Product: WebKit
           Version: WebKit Local Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: zyscoder at gmail.com
                CC: bugs-noreply at webkitgtk.org

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.`

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210604/c60f5aaf/attachment.htm>


More information about the webkit-unassigned mailing list