Closed Bug 432556 Opened 18 years ago Closed 18 years ago

Null pointer de-reference in [ToolbarWindow _toolbarPillButtonClicked:]

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect
Not set
critical

Tracking

()

RESOLVED FIXED

People

(Reporter: smichaud, Assigned: smichaud)

Details

Attachments

(1 file)

The [ToolbarWindow _toolbarPillButtonClicked:] method (in nsCocoaWindow.mm) sets its geckoWindow local variable as follows: nsCocoaWindow *geckoWindow = [[self delegate] geckoWidget]; But if the current ToolbarWindow's widget has been destroyed, [self delegate] will return nil, as will [[self delegate] geckoWidget]. So geckoWindow will be nil, and a crash will happen when it's de-referenced at the bottom of the method. Breakpad has recorded a couple of these crashes in the last week: http://crash-stats.mozilla.com/report/list?range_unit=weeks&query_search=signature&query_type=exact&platform=mac&branch=1.9&signature=-%5BToolbarWindow+_toolbarPillButtonClicked%3A%5D&query=-%5BToolbarWindow+_toolbarPillButtonClicked%3A%5D&range_value=1 The following two lines should be added after the line that sets geckoWindow: if (!geckoWindow) return;
Flags: wanted1.9.0.x?
Josh and Stuart: This fix is a no-brainer, and will need to be done at some point anyway. It's also possible that it could resolve bug 432005. Do you think it's worth trying to get it landed quickly, so that the guy who reported bug 432005 can try it in a nightly?
(In reply to comment #1) > It's also possible that it could resolve bug 432005. I don't see how, since it should never be possible to create a ToolbarWindow (or any of the other custom window classes used in XUL apps) in Camino.
Can we please get an actual patch on this bug with review flags set instead of a description of the patch?
>> It's also possible that it could resolve bug 432005. > > I don't see how, since it should never be possible to create a > ToolbarWindow (or any of the other custom window classes used in XUL > apps) in Camino. Oops, you're right. Sorry for the confusion.
Attached patch FixSplinter Review
Here it is.
Assignee: joshmoz → smichaud
Status: NEW → ASSIGNED
Attachment #319815 - Flags: review?(joshmoz)
Attachment #319815 - Flags: superreview?(roc)
Attachment #319815 - Flags: review?(joshmoz)
Attachment #319815 - Flags: review+
Comment on attachment 319815 [details] [diff] [review] Fix trivial fix, no risk
Attachment #319815 - Flags: superreview?(roc)
Attachment #319815 - Flags: superreview+
Attachment #319815 - Flags: approval1.9?
Attachment #319815 - Flags: approval1.9? → approval1.9+
landed on trunk
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Flags: wanted1.9.0.x?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: