Closed
Bug 1167723
Opened 11 years ago
Closed 10 years ago
Use of uninitialized class member nsViewManager::mPosY in nsView::SetDimensions(nsRect const&, bool, bool)
Categories
(Core :: Layout, defect)
Core
Layout
Tracking
()
RESOLVED
INVALID
People
(Reporter: bshas3, Unassigned)
Details
Attachments
(1 file)
|
141.11 KB,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.65 Safari/537.36
Steps to reproduce:
- Ran a Clang SA checker I wrote against Firefox source
Actual results:
- Clang Static Analyzer bug report attached. Plus, this is a potential call stack:
nsView::SetDimensions(nsRect const&, bool, bool)
nsViewManager::DoSetWindowDimensions(int, int)
nsViewManager::SetWindowDimensions(int, int)
nsView::WindowResized(nsIWidget*, int, int)
nsView::SetDimensions(nsRect const&, bool, bool)
nsViewManager::ResizeView(nsView*, nsRect const&, bool)
Expected results:
Initialize said class member in constructor
| Reporter | ||
Comment 1•11 years ago
|
||
Ditto for class member nsViewManager::mPosX in method nsView::SetDimensions()
Updated•11 years ago
|
Component: Untriaged → Layout
Flags: needinfo?(tnikkel)
Product: Firefox → Core
Comment 2•11 years ago
|
||
nsView has NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW here
http://mxr.mozilla.org/mozilla-central/source/view/nsView.h?rev=f58aab6a4e62#60
so all variables fields should be getting initialized with zeroed memory. So this seems fine. Does your static analyzer maybe need to be adjusted to know about NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW?
Flags: needinfo?(tnikkel) → needinfo?(bshas3)
| Reporter | ||
Comment 3•10 years ago
|
||
Likely a false positive.
FWIW: There are two problems here from an analyzer perspective, (1) the macro NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW, and (2) the memset library call.
Even if analyzer is made aware of (1), it is still going to flag uninitialized read because it does not model the side-effect of (2), the memset call.
Flags: needinfo?(bshas3)
Comment 4•10 years ago
|
||
Resolving invalid per comment 2.
Group: core-security
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Comment 5•10 years ago
|
||
Please comment or reopen if you disagree.
You need to log in
before you can comment on or make changes to this bug.
Description
•