NMEA Satellite Info parser: guard against DDoS


The current parser implementation does not remember the number of the
last sent sentence. As a result, we might end up in a situation where
a sentence with the same sentence number is sent again and again.
This can potentially trigger an OOM condition, because we will add the
newly parsed satellite info to a cached QList.

The proper way to fix it will be to modify the parser implementation
in such a way that it properly tracks the total number of sentences,
the current sentence, etc... However, this will be a rather
complicated change, which is not safe to backport to older branches.

This patch suggests a compromise approach of tracking the number of
satellites in the list. When it exceeds the hardcoded value of 1000,
clear the list, and return early. After that, drop all the follow-up
sentences with index != 1, because they will be considered as a
continuation of the DDoS attack.

Not picking to 5.15, because the whole parser logic is a bit different
there, and it is also not covered by the unit tests.

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