BlueZ: limit recursion when parsing SDP records
The implementation could recurse infinitely when parsing the "sequence"
elements of the service entry.
Limit the recursion by introducing a kMaxSdpRecursionDepth constant.
It is added as a static class-level variable, because it should also
be reused in the Windows implementation that has the same problem.
Add a unit-test to verify that the recursion limit works in practice.
Since this is a private API, enable this test only in developer build.
That is achieved by using Q_AUTOTEST_EXPORT and QT_BUILD_INTERNAL.
Task-number: QTBUG-145960
Pick-to: 6.11 6.8 6.5 5.15
Change-Id: I6dc3f79543dc2da6bf19927dca2edd1ae707c304
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>