Skip to content

Commit

Permalink
skip verification of class ID in JS_GetOpaque if class_id is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
bendmorris committed Sep 25, 2024
1 parent 6e2e68f commit 77b100d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -9847,7 +9847,7 @@ void *JS_GetOpaque(JSValueConst obj, JSClassID class_id)
if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)
return NULL;
p = JS_VALUE_GET_OBJ(obj);
if (p->class_id != class_id)
if (class_id && p->class_id != class_id)
return NULL;
return p->u.opaque;
}
Expand Down

0 comments on commit 77b100d

Please sign in to comment.