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>
commit64f4228f66db4dd1eed8a9c6507d73c146419f08
parent83cd078f893266e3835cb3fc1a286b38e89e281f
authorMagdalena Stojek <magdalena.stojek@qt.io>
committerMagdalena Stojek <magdalena.stojek@qt.io>
commit timeMon, 12 Oct 2026 08:04:51 +0000