Reject method calls with too few arguments
invokeMethod() checked the supplied argument count against the method's
parameter count only for the excess case. With too few,
invokeMethod_helper() indexed beyond the end of the JSON array and each
missing argument became the zeroed inline storage of an invalid
QVariant, handed to the callee under the declared metatype and
reinterpreted as that type. Wheter the result is merely a wrong value or
a null-pointer dereference depends on the declared type's
representation.
Reject such calls in the same guard chain, before any argument is
converted.
Pick-to: 6.8 6.12
Task-number: QTBUG-151083
Change-Id: I0da0f6280724044403d508ecee3405632e698f9d
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>