tc39 / proposal-arraybuffer-base64

TC39 proposal for Uint8Array<->base64/hex
https://tc39.github.io/proposal-arraybuffer-base64/
MIT License
248 stars 8 forks source link

fromBase64Into and fromHexInto: infinite loop #47

Closed ljharb closed 8 months ago

ljharb commented 8 months ago

https://tc39.es/proposal-arraybuffer-base64/spec/#sec-uint8array.fromhexinto step 14 and https://tc39.es/proposal-arraybuffer-base64/spec/#sec-uint8array.frombase64into step 22 are a loop, but it does not modify index in it, so they will loop forever.

Additionally, step 14.a of fromHexInto and step 22.a of fromBase64Into uses bytes[i], but i is not a variable defined in the algorithm.