]> git.codecow.com Git - libnemo.git/commitdiff
Check for index buffer with actual values.
authorChris Duncan <chris@codecow.com>
Sat, 8 Aug 2026 09:29:11 +0000 (02:29 -0700)
committerChris Duncan <chris@codecow.com>
Sat, 8 Aug 2026 09:29:11 +0000 (02:29 -0700)
src/lib/vault/parsers.ts

index 1fd9405f57f67c381fdb6736ea127d5e8fff7320..26dc60d5071b8c7158eb41b5e981252f7ff43748 100644 (file)
@@ -82,7 +82,7 @@ export function parseData (action: string, data: Record<string, unknown>) {
                }
 
                // Index(es) for child account to derive or sign
-               if ((action === 'derive' || action === 'sign') && !(data.index instanceof ArrayBuffer)) {
+               if ((action === 'derive' || action === 'sign') && (!(data.index instanceof ArrayBuffer) || data.index.byteLength < 1)) {
                        throw new TypeError('Index is required to derive an account private key')
                }
                const index = data.index instanceof ArrayBuffer