Actions
Bug #13714
openWt::Htpp::Client: race condition while emitting headersReceived signal
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/25/2025
Due date:
% Done:
0%
Estimated time:
Description
In case postSignals_ == true
and a linked session exists, emitHeadersReceived
may be executed simultaneously with handleReadContent
.
emitHeadersReceived
reads the whole message (i.e. it performs a copy of the message while emitting theheadersReceived
signal)handleReadContent
may change the body of the message.
Hence, a race condition may occur, resulting in UB / a crash.
Possible solution
A possible solution is to copy the message already when posting emitHeadersReceived
to the related session. An advantage of this solution is that the message provided as argument to the headersReceived
signal does not contain a (partial) message body in all cases. Hence, the headersReceived
signal is emitted with the exact same message independent of whether postSignals_
is true or false.
No data to display
Actions