[Automated review] Non-static class member field "span.last" is not initialized in this constructor nor in any functions that it calls
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Tracking
(firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: sfink, Assigned: sfink)
Details
Attachments
(1 file)
https://phabricator.services.mozilla.com/D30103?id=105050#inline-185350
This is incorrect. The constructor calls init(), which calls reset(), which assigns the whole 'span' field by copying from another FreeSpan object.
I guess it could be claiming that the firstFreeSpan doesn't always initialize its .last field? I don't know how far it chases through data flow.
Comment 1•5 years ago
|
||
I see init()
being called only in the explicit
ctor but in the default
one we only set some member variables but we don't set span
.
Comment 2•5 years ago
|
||
The priority flag is not set for this bug.
:sylvestre, could you have a look please?
For more information, please visit auto_nag documentation.
Comment 3•5 years ago
|
||
Steve what d you think about what I said in my previous message, do you think we should fix this by also initializing span
in the default ctor? Otherwise I think we should close this bug.
Assignee | ||
Comment 4•4 years ago
|
||
Updated•4 years ago
|
Assignee | ||
Comment 5•4 years ago
|
||
Sorry, you are correct, this was a real bug. I don't think it mattered in practice, because init() would always end up getting called, but the analysis is absolutely correct that this produces an opportunity to use the class in a way that would use uninitialized memory.
Thanks!
Pushed by sfink@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cb6ec14a123a Initialize FreeSpan in default constructor r=jonco
Comment 7•4 years ago
|
||
bugherder |
Updated•2 years ago
|
Description
•