]> git.codecow.com Git - libnemo.git/commitdiff
Fix data arg buffer zeroing.
authorChris Duncan <chris@codecow.com>
Wed, 5 Aug 2026 06:47:11 +0000 (23:47 -0700)
committerChris Duncan <chris@codecow.com>
Wed, 5 Aug 2026 06:47:11 +0000 (23:47 -0700)
src/lib/vault/parsers.ts

index 4b76cc4d437765b072918df4df78078449405096..e140e5140d680b785793a2a96ca7e731d62563b7 100644 (file)
@@ -49,7 +49,7 @@ export function parseData (action: string, data: Record<string, unknown>) {
                        }
                        seed = data.seed.slice()
                }
-               new Uint8Array(data.seed).fill(0)
+               new Uint8Array(data.seed ?? []).fill(0)
                delete data.seed
 
                // Mnemonic phrase to load
@@ -80,7 +80,7 @@ export function parseData (action: string, data: Record<string, unknown>) {
                        }
                        encrypted = data.encrypted.slice()
                }       
-               new Uint8Array(data.encrypted).fill(0)
+               new Uint8Array(data.encrypted ?? []).fill(0)
                delete data.encrypted
 
                // Index for child account to derive or sign
@@ -101,7 +101,7 @@ export function parseData (action: string, data: Record<string, unknown>) {
                        }
                        message = data.message.slice()
                }
-               new Uint8Array(data.message).fill(0)
+               new Uint8Array(data.message ?? []).fill(0)
                delete data.message
 
                // Vault configuration