Bug 276859
| Summary: | [JSC] `Uint8Array#setFromBase64` should decode and write chunks which occur prior to bad data | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Sosuke Suzuki <sosuke> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Sosuke Suzuki
According to the spec[1][2] and the test[3], Uint8Array.prototype.setFromBase64 throws a SyntaxError
when encountering bad data but writes the decoded chunks prior to bad data.
However, the current JSC discards the decoded data upon encountering bad data and throws an error.
[1]: https://tc39.es/proposal-arraybuffer-base64/spec/#sec-uint8array.prototype.setfrombase64
[2]: https://tc39.es/proposal-arraybuffer-base64/spec/#sec-frombase64
[3]: https://github.com/tc39/test262/blob/main/test/built-ins/Uint8Array/prototype/setFromBase64/writes-up-to-error.js
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Sosuke Suzuki
Pull request: https://github.com/WebKit/WebKit/pull/31037
EWS
Committed 281174@main (77046030809c): <https://commits.webkit.org/281174@main>
Reviewed commits have been landed. Closing PR #31037 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/132198988>