Closed Bug 2063214 Opened 2 months ago Closed 2 months ago

Move instead of copy the CrashEventID string in CrashReporterHost::FinalizeCrashReport

Categories

(Core :: IPC, defect)

defect

Tracking

()

RESOLVED FIXED
156 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox-esr153 --- unaffected
firefox154 --- unaffected
firefox155 --- wontfix
firefox156 --- fixed

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 external file)

Coverity CID 1700061 (COPY_INSTEAD_OF_MOVE) flags ipc/glue/CrashReporterHost.cpp:99:

NSID_TrimBracketsASCII uuidString(nsID::GenerateUUID());
mExtraAnnotations[CrashReporter::Annotation::CrashEventID] = uuidString;

uuidString is a local that is dead after this statement, so it should be assigned with std::move rather than copied.

In practice this is cosmetic: NSID_TrimBracketsASCII is an nsAutoCStringN whose inline buffer is large enough for a UUID, so the move assignment still copies the characters and cannot steal the storage. The change is purely to express the intent correctly and to silence the checker.

Introduced by bug 2058676.

Assignee: nobody → sledru

uuidString is dead after the assignment, so move it instead of copying.
Fixes Coverity CID 1700061 (COPY_INSTEAD_OF_MOVE).

Pushed by sledru@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b1b54b0a14ad https://hg.mozilla.org/integration/autoland/rev/9e639d72dd3f Move instead of copy the CrashEventID string in CrashReporterHost::FinalizeCrashReport r=gsvelto,afranchuk,ipc-reviewers,mccr8
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch

The patch landed in nightly and beta is affected.
:Sylvestre, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(sledru)
Flags: needinfo?(sledru)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: