Fix Coverity COPY_INSTEAD_OF_MOVE defects in WebRTC signaling (move Maybe<RTCErrorParams>)
Categories
(Core :: WebRTC: Signaling, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox155 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: Sylvestre)
References
(Blocks 1 open bug)
Details
Attachments
(3 external files)
Coverity Scan reported COPY_INSTEAD_OF_MOVE defects in the WebRTC signaling code. In each case a Maybe<dom::RTCErrorParams> (an error/aError value) is passed by value to a callee that takes it by value, at the variable's last use, so it can be moved instead of copied:
- CID 1696626:
MediaTransportHandlerSTS::OnStateChange->MediaTransportHandler::OnStateChange(MediaTransportHandler.cpp) - CID 1696625:
MediaTransportHandlerSTS::OnRtcpStateChange->MediaTransportHandler::OnRtcpStateChange(MediaTransportHandler.cpp) - CID 1696624:
MediaTransportChild::RecvOnStateChange->OnStateChange(MediaTransportHandlerIPC.cpp) - CID 1696623:
MediaTransportChild::RecvOnRtcpStateChange->OnRtcpStateChange(MediaTransportHandlerIPC.cpp) - CID 1696621:
PeerConnectionImpl::OnDtlsStateChange->RTCDtlsTransport::UpdateState(PeerConnectionImpl.cpp) - CID 1696620:
PeerConnectionImpl::OnRtcpStateChange->OnDtlsStateChange(PeerConnectionImpl.cpp)
Fix: wrap the argument in std::move.
| Assignee | ||
Comment 1•3 months ago
|
||
Fixes Coverity CID 1696626 and CID 1696625 (COPY_INSTEAD_OF_MOVE): the
error value is at its last use when forwarded to the base
OnStateChange/OnRtcpStateChange, so move it instead of copying.
Updated•3 months ago
|
| Assignee | ||
Comment 2•3 months ago
|
||
Fixes Coverity CID 1696624 and CID 1696623 (COPY_INSTEAD_OF_MOVE): the
error parameter is at its last use when forwarded to
OnStateChange/OnRtcpStateChange, so move it instead of copying.
| Assignee | ||
Comment 3•3 months ago
|
||
Fixes Coverity CID 1696621 and CID 1696620 (COPY_INSTEAD_OF_MOVE): aError
is at its last use when forwarded to UpdateState/OnDtlsStateChange, so
move it instead of copying.
Comment 7•3 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/56127d99715f
https://hg.mozilla.org/mozilla-central/rev/443738be761a
https://hg.mozilla.org/mozilla-central/rev/115902587b88
Updated•2 months ago
|
Description
•