You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
use quick_js::Context;fnmain(){let context = Context::new().unwrap();
context.eval(r#"(async function() { await new Promise((r,j)=>{for(let i = 0; i < 20; i++);})})() "#).unwrap();}
The text was updated successfully, but these errors were encountered:
DarkRTA
changed the title
Null pointer defererence in quick_js::bindings::OwnedObjectRef::property
Null pointer dereference in quick_js::bindings::OwnedObjectRef::property
Dec 31, 2021
This method will return or resolve to null because you don't return the result of your inner promise.. plus you don't resolve your inner promise so even if you return it the outer async func will never resolve..
That's not the point. The point is that no code you run in the JS engine should cause memory safety issues, especially when this crash is caused by this crate and not quickjs itself.
I've tested this in the quickjs interpreter (outside of this crate) and it did not crash at all, so this is entirely an issue with the bindings.
The following snippet of code causes a null pointer to be passed as the first argument of
JS_GetPropertyStr
, causing a null pointer dereference inJS_NewAtomLen
quickjs-rs/src/bindings/value.rs
Line 427 in 941b361
The text was updated successfully, but these errors were encountered: