Remove the unused nsProfileLock copy constructor
Categories
(Toolkit :: Startup and Profile System, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: jreitano, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [lang=c++])
Attachments
(1 external file)
Filing as a good first bug to learn workflows.
nsProfileLock(nsProfileLock& src) is implemented as *this = src;, which calls operator= and therefore Unlock() on uninitialized members. Nothing uses this constructor, so delete it (declaration in nsProfileLock.h and definition in nsProfileLock.cpp) or mark it = delete.
Current code:
nsProfileLock();
nsProfileLock(nsProfileLock& src);
Link to the code:
https://searchfox.org/firefox-main/source/toolkit/profile/nsProfileLock.h
To verify the fix:
./mach build
./mach gtest 'ProfileLock*'
This was reported by Coverity Scan (CID 1512664). The analyzer will stop reporting it once the change lands.
Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html
Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.
| Assignee | ||
Comment 1•2 days ago
|
||
I volunteer to work on this bug.
| Assignee | ||
Updated•2 days ago
|
| Assignee | ||
Comment 2•2 days ago
|
||
It called operator=, and so Unlock(), on uninitialized members. Nothing uses it, so mark it deleted rather than fix it.
| Assignee | ||
Updated•2 days ago
|
Comment 4•1 day ago
|
||
| bugherder | ||
Description
•