Initialize variables before calling QModbusPdu::decodeData()


The method uses QDataStream internally, which might leave the passed
parameter unmodified in case of an internal error.
So make sure to initialize the variables with some reasonable defaults
before calling decodeData().

In most cases this might not be strictly needed, because we do have
preceeding checks that the raw data has enough bytes. Still, while
doing this changes, I identified a couple of places where such checks
are missing.

Pick-to: 6.9 6.8 6.5
Change-Id: I2e2fe1cc41a4f7082cf8fea880c16aa7b6a8d418
Reviewed-by: André Hartmann <aha_1980@gmx.de>
commit995b5a521426c4c4897c677e0d21fed738dc05fc
parentaef3f98ecde3d6c9dad21f7321d4deac564866f2
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeFri, 25 Apr 2025 14:33:37 +0200