Skip to content

Null pointer dereference in quick_js::bindings::OwnedObjectRef::property #122

@DarkRTA

Description

@DarkRTA

The following snippet of code causes a null pointer to be passed as the first argument of JS_GetPropertyStr, causing a null pointer dereference in JS_NewAtomLen

q::JS_GetPropertyStr(self.value.context.context, self.value.value, cname.as_ptr())

use quick_js::Context;

fn main() {
    let context = Context::new().unwrap();
    context.eval(r#"
(async function() {
    await new Promise((r,j)=>{for(let i = 0; i < 20; i++);})
})()
    "#).unwrap();
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions