NMEA Satellite Info parser: reject negative sentence numbers


When parsing an NMEA GSV message, we extract various integer numbers
that represent the total number of sentences, the index of the current
sentence, and the total number of visible satellites. These values
cannot be negative (and the first two also cannot be zero).
So, use quint32 to store these variables and use QBA::toUInt()
when reading them.

Since sentence and totalSats are now quint32, extend the range of
numSatInSentence to qint64, making sure that we do not accidentally
truncate the result.
This also requires to change the type of the index variable in the
for loop iterating over numSatInSentence.

Add unit-tests that cover these cases.

Since the very large negative sentence number could underflow when
multiplied by four, and thus cause an UB, pick this patch down to 6.5.
Do not pick to 5.15, because the entire satelliteinfo parser logic is
slightly different there, and also it is missing test coverage.

Task-number: QTBUG-146551
Pick-to: 6.11 6.8 6.5
Change-Id: I40b57edfcebaf897c04c96cd15b396e12fc41cda
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
commitb646e87811f790b564f392f6b436cefed7aa9c5e
parent5b83f1389ee4802f58eac7c3c4a96bed045b4ea9
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeTue, 19 May 2026 08:58:54 +0000