]> git.kaiwu.me - quickjs.git/commitdiff
added missing NULL pointer check (#504)
authorFabrice Bellard <fabrice@bellard.org>
Thu, 14 May 2026 13:43:42 +0000 (15:43 +0200)
committerFabrice Bellard <fabrice@bellard.org>
Thu, 14 May 2026 14:39:41 +0000 (16:39 +0200)
quickjs.c

index 84474d1d1fdcb8e54f2f9883c031e466839a6666..dcd0fd6950839083107896bde9646678f0d73f2a 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -48100,6 +48100,8 @@ static BOOL check_regexp_getter(JSContext *ctx,
         return FALSE;
     if ((prs->flags & JS_PROP_TMASK) != JS_PROP_GETSET)
         return FALSE;
+    if (!pr->u.getset.getter)
+        return FALSE;
     return JS_IsCFunction(ctx, JS_MKPTR(JS_TAG_OBJECT, pr->u.getset.getter),
                           func, magic);
 }