Closed Bug 96514 Opened 24 years ago Closed 24 years ago

Getting a nonexistent pref should not stuff bogus value into result

Categories

(Core :: Preferences: Backend, defect)

defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla0.9.4

People

(Reporter: ccarlen, Assigned: bnesse)

Details

Attachments

(1 file)

This is a problem is where somebody uses code like this (very common): PRBool paintFrameCounts = PR_FALSE; prefs->GetBoolPref("layout.reflow.showframecounts", &paintFrameCounts); without checking the result code. It assumes that, if the pref does not exist, the PRBool param it passed will be untouched. That's why it initialized it beforehand. Reasonable. That's what I'd expect. Unfortunately, if the pref in question has had its user value reset, which happens in profile switching, a bogus value will be returned.
This blocks bug 86021. If I can get it reviewed an in today... It's extremely low risk. Chris, can you sr=?
Blocks: 86021
Looks like what we discussed. r=bnesse.
Keywords: nsbranch
Target Milestone: --- → mozilla0.9.4
While this is a serious problem and should be checked in ASAP anyway, it appears to no longer be blocking bug 86021. On testing that patch without this one over the past 2 days, the problem this bug causes has mysteriously disappeared. Removing blockage.
No longer blocks: 86021
sr=sfraser
a=dbaron (on behalf of drivers)
Checked in.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
rubberstamp.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: