mirror of
https://github.com/bitwarden/browser.git
synced 2024-12-20 16:07:45 +01:00
6d89c0f157
The original implementation of bufferSourceToUint8Array was incorrect as it did not consider that TypedArray instances represent a view of the underlying ArrayBuffer which does not necessarily cover the entire backing ArrayBuffer. This resulted in the output of this function containing data which would not be logically contained in the input. This was partially fixed by #8787 for the common case of the input already being an Uint8Array, but it was still broken for any other TypedArrays. But #8222 introduced another copy of the original broken code, breaking the Uint8Array case again. Fix this once and hopefully for the last time with a correct implementation of bufferSourceToUint8Array and using that in the appropriate places instead of open-coding it. In addition there are now tests which exercise most edge cases with regards to ArrayBuffer and TypedArrays. |
||
---|---|---|
.. | ||
spec | ||
src | ||
custom-matchers.d.ts | ||
jest.config.js | ||
package.json | ||
test.setup.ts | ||
tsconfig.json | ||
tsconfig.spec.json |