SDP scanner: limit recursion depth in parseAttributeValue()


The patch 0124934456be1040d5887cbb2720d388e4bfb61b fixed the recursion
issues in the BlueZ implementation of the service discovery. However,
that code only parses the data that it receives from the sdpscanner
tool.

This patch addresses the second recursion issue in the tool itself:
when parsing SDP_SEQ{8,16,32} and SDP_ALT{8,16,32} elements, the
function is recursing without any limitation. That could cause stack
overflow in case of malicious SDP records.

The fix is similar to 0124934456be1040d5887cbb2720d388e4bfb61b - limit
the recursion depth to 64 levels.

Task-number: QTBUG-145960
Pick-to: 6.11 6.8 6.5 5.15
Change-Id: Idefaa6e9c5e3abbcd77bbb3203012dcb560d0730
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
commit0f783a901e47717931bb442266b67fb3fb7aca7d
parentbc262bc82ef4fcdfb4ceff5bc78864f4f218cd9e
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeTue, 19 May 2026 10:55:53 +0000