Closed
Bug 1488452
Opened 7 years ago
Closed 7 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•7 years ago
|
||
I misunderstood the semantics of GetLogicalDriveStringsW. There's still a bug somewhere around here.
| Assignee | ||
Comment 2•7 years ago
|
||
| Assignee | ||
Comment 3•7 years ago
|
||
Also rewrote some code around the actual problem to be more obviously correct
and comprehensible.
MozReview-Commit-ID: FF2hSjQ4U1x
| Assignee | ||
Comment 4•7 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•7 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•7 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•7 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•7 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•7 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 7 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
•