]> git.codecow.com Git - libnemo.git/commitdiff
Zero out password if put throws.
authorChris Duncan <chris@zoso.dev>
Thu, 3 Jul 2025 16:57:25 +0000 (09:57 -0700)
committerChris Duncan <chris@zoso.dev>
Thu, 3 Jul 2025 16:57:25 +0000 (09:57 -0700)
src/lib/workers/safe.ts

index 4ade2451425a506903e9bf414f0848c32bcfae78..e30c2c08af865d6a14d342f7a4425b4d4e183b1c 100644 (file)
@@ -88,6 +88,7 @@ export class Safe extends WorkerInterface {
        */
        static async put (name: string, password: Uint8Array, data: any): Promise<boolean> {
                if (this.#storage.getItem(name)) {
+                       password.fill(0)
                        throw new Error(ERR_MSG)
                }
                return this.overwrite(name, password, data)