Skip to content

Assertion failure (possible security hole?) #236

Closed
@cscott

Description

@cscott
> var sqlite3 = require('sqlite3');
> db = new sqlite3.Database('foo.db')
> o = { close: db.close };
> o.close()
node: /home/cananian/.node-gyp/0.10.22/src/node_object_wrap.h:61: static T* node::ObjectWrap::Unwrap(v8::Handle<v8::Object>) [with T = node_sqlite3::Database]: Assertion `handle->InternalFieldCount() > 0' failed.
Aborted

You should use the Signature parameter to v8 FunctionTemplate to prevent calling methods with the improper receiver type. (And then you should also use accessor.Holder() instead of accessor.This() when you unwrap.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions