GNOME Bugzilla – Bug 611590
gjs_callback_from_arguments accesses argv out of bounds
Last modified: 2010-03-02 22:20:56 UTC
Adding some assertions makes it clear. In practice it might work deterministically, but I don't think it's good practice.
Created attachment 155032 [details] [review] gi: assert gjs_callback_from_arguments doesn't access argv out of bounds
Created attachment 155037 [details] [review] gi: do not collect user_data argument(s) for callbacks when not passed I'm not entirely sure if the logic is completely correct here. make check passes, though.
Review of attachment 155037 [details] [review]: API breakage but should be okay. Missing tests!
There are tests already. The first patch makes it fail, the latter fixes it. From what I can tell the original code was using an uninitialized value as argument and I don't believe that was intended API. Or maybe the value (argv[argv]) is deterministically initialized but I don't know immediately what value that might be.
Sure, sounds good then, just commit it.