HCI ACL: use length information from the header instead of buffer size


When parsing the HCI ACL packet, the code was extracting the data
length from L2CAP header, but then used the size of the received
buffer to verify that we got the expected amount of data.

Theoretically, we could get a packet with a smaller length (some
different type, maybe?), but also get some extra trailing bytes in
the buffer. In which case, we could misinterpret such packet as a
Signing Information packet.

Fix by verifying that the header contains the proper length value. The
check that the buffer has enough data is already done earlier.

Task-number: QTBUG-145934
Pick-to: 6.11 6.8
Change-Id: Id2d868fc235586da4bae5b02091a778730820111
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
commit3b8158b23c7db594bcded837c782053843a3d15a
parentf50895eea0e6e9ad48a6d5fb482b7b81ea1d704c
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeThu, 23 Apr 2026 15:24:20 +0000