Skip to content

Null Pointer Dereference in build_for_in_iterator #192

Closed
@anbu1024

Description

@anbu1024

QuickJS version:
2788d71

Test case:

function foo() {
    
    function Bar() {
    }
    
    class Apple extends Bar {
        constructor(a) {
            (() => {
            	for (const i in this) {}
                eval(a);
                return 0;
            })();
        }
    }
    const y = new Apple();
    return y;
}

let x = new Promise(foo);

Error:
crashed due to null pointer deference,

In function JSValue build_for_in_iterator(JSContext *ctx, JSValue obj), line 15129, the

p = JS_VALUE_GET_OBJ(obj);

returns 0.

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