Closed Bug 1906649 Opened 1 year ago Closed 1 year ago

GfxInfo::Init() doesn't check the return value of PR_sscanf

Categories

(Core :: Graphics, task)

task

Tracking

()

RESOLVED FIXED
130 Branch
Tracking Status
firefox130 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

See here. It looks like maybe this function should fail if PR_sscanf fails.

Is this causing an actual issue for you, and if so, what is the use case?

If PR_sscanf fails then mWindowsVersion will remain the default kWindowsUnknown, which seems reasonable to me. I'm not sure if failing gfxInfo initialisation is preferable to that. Perhaps people using MOZ_GFX_SPOOF_WINDOWS_VERSION would like it to be obvious if they for example have a typo causing it to not act as intended, but equally perhaps they may like the ability to spoof an unknown version.

Severity: -- → S4

No, this is not causing an issue. I was looking over the places that don't check the return value because of bug 265693. That does sound like a reasonable default.

Assignee: nobody → continuation
Type: defect → task

Init() is only called once after GfxInit is initially created, so
if PR_sscanf fails then the values of mWindowsVersion and
mWindowsBuildNumber will remain at their default values, which
are reasonable.

It is a little inconsistent here because this method does explicitly set mWindowsVersion to kWindowsUnknown if GetVersionEx fails but eh not a big deal.

Pushed by amccreight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d048b8e3e5ef Ignore the return value of PR_sscanf in GfxInfo::Init(). r=gfx-reviewers,win-reviewers,gstoll,jnicol
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 130 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: