[Webkit-unassigned] [Bug 223646] New: [GTK][WPE] JSC crashes if a function expects a parameter but doesn't receive any

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 23 10:39:01 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=223646

            Bug ID: 223646
           Summary: [GTK][WPE] JSC crashes if a function expects a
                    parameter but doesn't receive any
           Product: WebKit
           Version: Other
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: WebKitGTK
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: berto at igalia.com
                CC: bugs-noreply at webkitgtk.org

Created attachment 424039

  --> https://bugs.webkit.org/attachment.cgi?id=424039&action=review

Test case

The attached test case uses the JSC API to create a function named "foo()" that receives a parameter of type JSCValue:

        jsc_value_new_function(ctx,
                "foo",
                G_CALLBACK(foo_cb),
                NULL,            // user_data
                NULL,            // destroy_notify
                G_TYPE_NONE,     // return_type
                1,               // n_params
                JSC_TYPE_VALUE)

The callback foo_cb() simply prints the value to the standard output, you can see it with ./test 'foo(4)' or ./test 'foo("Hello world")'

However if you call foo() without any parameters the process crashes before foo_cb() even gets called.

   GLib-GObject:ERROR:../../../gobject/gclosure.c:1169:value_to_ffi_type: assertion failed: (type != G_TYPE_INVALID)
   Aborted

This should produce an exception that the program can handle.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210323/b81733d0/attachment.htm>


More information about the webkit-unassigned mailing list