Skip to content

sqlite: createTagStore() accepts invalid maxSize values (negative , NaN , float) #63791

@Anshikakalpana

Description

@Anshikakalpana

Version

v26.3.0

Platform

Windows

Subsystem

sqlite

What steps will reproduce the bug?

const { DatabaseSync } = require('node:sqlite');
const db = new DatabaseSync(':memory:');
console.log(db.createTagStore(-1).capacity);   // 18446744073709552000 (overflow)
console.log(db.createTagStore(NaN).capacity);  // garbage value
console.log(db.createTagStore(1.5).capacity);  // accepts float silently

How often does it reproduce? Is there a required condition?

everytime!

What is the expected behavior? Why is that the expected behavior?

maxSize is documented as {integer} and represents a cache size — negative values, NaN, and floats should throw ERR_INVALID_ARG_TYPE or ERR_OUT_OF_RANGE.

What do you see instead?

Invalid values are silently accepted, causing integer overflow and garbage capacity values.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions