Closed Bug 1167723 Opened 10 years ago Closed 10 years ago

Use of uninitialized class member nsViewManager::mPosY in nsView::SetDimensions(nsRect const&, bool, bool)

Categories

(Core :: Layout, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: bshas3, Unassigned)

Details

Attachments

(1 file)

Attached file report-6b3198.html
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
Ditto for class member nsViewManager::mPosX in method nsView::SetDimensions()
Component: Untriaged → Layout
Flags: needinfo?(tnikkel)
Product: Firefox → Core
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)
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)
Resolving invalid per comment 2.
Group: core-security
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → INVALID
Please comment or reopen if you disagree.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: