Handle property change with invalid index
The PropertyChangePacket handling logic on the replica side always
assumes that the incoming index is valid.
If the host sends a malformed packet with a negative index or an
index that exceeds the size of the internal property storage, the
code writes past the end of the allocated memory.
This patch checks the incoming property index against the total
number of properties of the replica, and ignores the packet if the
index is negative or too large.
The new test sends a hand-crafted ProprtyChangePacket to the
replica and verifies that it is ignored. It was crashing without
the fix.
Task-number: QTBUG-150780
Pick-to: 6.12 6.8 6.5 5.15
Change-Id: Idc71c7ed155c9b8aaf66c8e4f5da34d2fa679d06
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>