[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•6 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•6 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•6 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•6 years ago
|
||
Updated•6 years ago
|
| Assignee | ||
Comment 5•6 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!
Comment 7•6 years ago
|
||
| bugherder | ||
Updated•3 years ago
|
Description
•