GfxInfo::Init() doesn't check the return value of PR_sscanf
Categories
(Core :: Graphics, task)
Tracking
()
| 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.
Comment 1•1 year ago
|
||
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.
| Assignee | ||
Comment 2•1 year ago
|
||
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 | ||
Comment 3•1 year ago
|
||
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.
| Assignee | ||
Comment 4•1 year ago
|
||
It is a little inconsistent here because this method does explicitly set mWindowsVersion to kWindowsUnknown if GetVersionEx fails but eh not a big deal.
Comment 6•1 year ago
|
||
| bugherder | ||
Description
•