Closed
Bug 279979
Opened 20 years ago
Closed 19 years ago
Possible buffer overrun in nsFontMetricsPh::Init
Categories
(Core Graveyard :: GFX, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: sicking, Assigned: amardare)
References
()
Details
(Whiteboard: [sg:low] photon only)
The sprintf into prop[256] in nsFontMetricsPh::Init seems like it could overrun the size of the buffer. I'd suggest using a safer printf function from NSPR, or using simple string join-operators.
Comment 1•20 years ago
|
||
Or failing that, max-width specifiers in the format string.
Flags: blocking-aviary1.1?
Whiteboard: [sg:fix]
Updated•20 years ago
|
OS: other → Neutrino
FYI Adrian is the guy you want - I have no involvement in Mozilla development. Reassigning.
Assignee: cwiebe → amardare
Comment 3•20 years ago
|
||
Why does this have [sg:fix]?
Comment 4•19 years ago
|
||
transferring nomination to 1.8b4. If we don't get it there, we don't get it for 1.1
Flags: blocking-aviary1.1? → blocking1.8b4?
Updated•19 years ago
|
Flags: blocking1.8b4? → blocking1.8b4-
Comment 5•19 years ago
|
||
Is anyone ever going to fix this one? Maybe we should remove the group set so someone who cares about Photon can see it. [sg:low] on the assumption that the strings involved come from installed fonts. If they're taken directly from a web page's styles without vetting against the installed list then this would be sg:critical. Simple fix, either format width specifiers, snprintf, or the PR_ equivalent. Someone who can compile on photon would have to review/test. Or we could simply WONTFIX the bug for lack of interest.
Whiteboard: [sg:fix] → [sg:low] photon only
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 6•19 years ago
|
||
Reopening, this bug has not been fixed. If the bug is invalid in that it's not exploitable please mark it INVALID
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Reporter | ||
Comment 7•19 years ago
|
||
wha! sorry, my bad.
Status: REOPENED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → FIXED
Comment 8•19 years ago
|
||
(In reply to comment #7) > wha! sorry, my bad. > did you mean to mark it fixed again? char *prop = PR_smprintf( "font.name.%s.%s", str, cstring ); is still there.
| Reporter | ||
Comment 9•19 years ago
|
||
I didn't actually check that the new code was safe, i just put the bug back to the state it was in. Not sure if PR_smprintf is safe or not. Adrian: please attach a patch to the bug when you fix it. This is why I didn't think the bug was fixed at first, because there was no activity in the bug. This is especially important for security patches.
Updated•19 years ago
|
Group: security
Comment 10•17 years ago
|
||
PR_smprintf() mallocs sufficient space, it's fine. The original code used a plain sprintf() into a fixed-size buffer.
Flags: wanted1.8.1.x+
Updated•16 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•