Closed
Bug 1488452
Opened 6 years ago
Closed 6 years ago
Avoid writing past the logical length of a string in FileUtilsWin.h
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: hsivonen, Assigned: hsivonen)
References
Details
Attachments
(1 file)
The call to GetLogicalDriveStringsW first writes and then sets length.
Assignee | ||
Comment 1•6 years ago
|
||
I misunderstood the semantics of GetLogicalDriveStringsW. There's still a bug somewhere around here.
Assignee | ||
Comment 2•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=9f1073d2aa1411a33f06b8316f18f12c46ed2f19
Assignee | ||
Comment 3•6 years ago
|
||
Also rewrote some code around the actual problem to be more obviously correct and comprehensible. MozReview-Commit-ID: FF2hSjQ4U1x
Assignee | ||
Comment 4•6 years ago
|
||
I took a look of the our other uses of PromiseFlatString and PromiseFlatCString and, fortunately, this seems to be a unique misuse of PromiseFlatString.
Assignee | ||
Comment 5•6 years ago
|
||
https://searchfox.org/mozilla-central/source/gfx/vr/gfxVROculus.cpp#658 started asserting about non-ASCII. I don't know why it started now, but using AppendPrintf to build a Windows file path seems suspicious to begin with.
Assignee | ||
Comment 6•6 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #5) > https://searchfox.org/mozilla-central/source/gfx/vr/gfxVROculus.cpp#658 > started asserting about non-ASCII. I don't know why it started now, but > using AppendPrintf to build a Windows file path seems suspicious to begin > with. Ah, that code also has the write-past-mLength pattern, but I failed to find it on searchfox, because it's #ifdefed out as far as searchfox can tell.
Assignee | ||
Comment 7•6 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #6) > (In reply to Henri Sivonen (:hsivonen) from comment #5) > > https://searchfox.org/mozilla-central/source/gfx/vr/gfxVROculus.cpp#658 > > started asserting about non-ASCII. I don't know why it started now, but > > using AppendPrintf to build a Windows file path seems suspicious to begin > > with. > > Ah, that code also has the write-past-mLength pattern, but I failed to find > it on searchfox, because it's #ifdefed out as far as searchfox can tell. Bug 1489462.
Comment 8•6 years ago
|
||
Comment on attachment 9006947 [details] Bug 1488452 - Remove incorrect use of PromiseFlatString in FileUtilsWin. Nathan Froyd [:froydnj] has approved the revision.
Attachment #9006947 -
Flags: review+
Pushed by hsivonen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/36ee80fc14ae Remove incorrect use of PromiseFlatString in FileUtilsWin. r=froydnj
Comment 10•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/36ee80fc14ae
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•