Version
v27.0.0-pre (884f9cd62da)
Platform
Subsystem
sqlite
What steps will reproduce the bug?
node:sqlite's backup() checks that its first argument is an object, then unwraps it. Passing anything other than a DatabaseSync results in a crash:
const { backup } = require('node:sqlite');
backup({}, '/tmp/c1a.db');
Similarly, the DatabaseSync constructor treats any object as a URL if it has a string href. If that href doesn't parse, it crashes:
const { DatabaseSync } = require('node:sqlite');
new DatabaseSync({ href: 'zzz' });
How often does it reproduce? Is there a required condition?
It's consistent.
What is the expected behavior? Why is that the expected behavior?
Both should raise a TypeError.
What do you see instead?
A segfault.
Additional information
No response
Version
v27.0.0-pre (
884f9cd62da)Platform
Subsystem
sqlite
What steps will reproduce the bug?
node:sqlite's
backup()checks that its first argument is an object, then unwraps it. Passing anything other than aDatabaseSyncresults in a crash:Similarly, the
DatabaseSyncconstructor treats any object as aURLif it has a stringhref. If thathrefdoesn't parse, it crashes:How often does it reproduce? Is there a required condition?
It's consistent.
What is the expected behavior? Why is that the expected behavior?
Both should raise a
TypeError.What do you see instead?
A segfault.
Additional information
No response