Closed gibson042 closed 7 months ago
jsDecodeBase64 incorrectly accepts short encodings that leave bits hanging in the register, and the incorrectness is visible in Node.js.
jsDecodeBase64
$ node --input-type=module -e ' import "@endo/init"; import { decodeBase64 } from "@endo/base64"; console.log(decodeBase64("Z")); console.log(decodeBase64("V1RGZ")); '
An error.
Uint8Array(0) [] Uint8Array(3) [ 87, 84, 70 ]
Describe the bug
jsDecodeBase64
incorrectly accepts short encodings that leave bits hanging in the register, and the incorrectness is visible in Node.js.Steps to reproduce
Expected behavior
An error.
Actual behavior