Skip to content

Three backports (Websocket reading error on reconnect, ignoreSslErrors, UB)

Re conflict in patch 1, I did not see how the changed code would affect the backport, but can't hurt for a reviewer to check as well.

[PATCH 1/3] Clear frame on reconnect

Otherwise partial data could leak through to next connection and cause
odd behavior

* asturmlechner 2021-12-22: Fix conflict with dev branch aeeaa00f

Pick-to: 5.15
Fixes: QTBUG-88923
Change-Id: I6c75e6325527379bcdca0b9819a89437d0658893
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 9f6449ef1b6d1e7651f181585f1c35d6722bb87a)

[PATCH 2/3] Pass ignoreSslErrors to unterlying QSslSocket

When setting ignoreSslErrors(List<QSslError>) during the sslErrors
signal handling the call got ignored. Only the internal config for
creating a QSslSocket would be updated but not the current QSslSocket.
The request of the caller to ignore specific QSslErrors would be
ignored.

Pick-to: 5.12 5.15 6.2
Change-Id: I6aaea2111fe1d26e07e6eaaa7532ae1b14a187a8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit b13f23d232cfdd372ef812d427872d52eed2337e)

[PATCH 3/3] QWebSocketProtocol: fix potential UB (signed overflow) in masking operation

The size of the payload is a 64-bit integer, which the loop counts
down. If the size is > INT_MAX, then we'll overflow the int i used to
track the current position in the mask.

Fix by using an unsigned integer type instead.

Pick-to: 6.3 6.2 5.15
Change-Id: Ia3b8d42ae906eb03c1c7399cb1137a08121fcde3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 38218494a65049b5f9da7a8aab012a969c7dac86)
Edited by Andreas Sturmlechner

Merge request reports