QGrpcHttp2Channel: sanitize server-controlled bytes in warning logs


Three qCWarning calls printed server-controlled header keys and values
via printf-style %s, letting a hostile server inject newlines, NUL
bytes, or other control characters into the log stream (CWE-117).

Wrap each server-supplied operand in sanitizedForLog(), which delegates
to QtDebugUtils::toPrintable() to escape non-printable bytes and bound
the logged output at 256 bytes, preventing log flooding.

As a drive-by, fix the "unexcpected" typo in the grpc-reserved-header
messages.

Pick-to: 6.12 6.11 6.8
Fixes: QTBUG-148149
Change-Id: Icbd4a73a3ffb0890a4b9abe4144ecca47d87c873
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
commitae0cd2f5e8d06e56940c94fcce4c0ca83cfbcbd6
parent73e54ca3dc29465412d23ec80d5473d7010c4276
authorDennis Oberst <dennis.oberst@qt.io>
committerDennis Oberst <dennis.oberst@qt.io>
commit timeTue, 21 Jul 2026 18:18:32 +0000