Closed
Bug 346250
Opened 19 years ago
Closed 19 years ago
nsDiskCacheMap.cpp closes wrong filedescriptor (when metadata is written to a separate file!)
Categories
(Core :: Networking: Cache, defect)
Core
Networking: Cache
Tracking
()
VERIFIED
FIXED
People
(Reporter: alfredkayser, Assigned: alfredkayser)
Details
Attachments
(1 file)
1.16 KB,
patch
|
darin.moz
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
At line:
http://lxr.mozilla.org/mozilla/source/netwerk/cache/src/nsDiskCacheMap.cpp#792
792 PRStatus err = PR_Close(mMapFD);
The mMapFD is wrong, this should be 'fd' to close the file opened for writing/saving the metadata of that specific cache entry.
Luckely, cacheEntry metadata never seems to be bigger than 16K so it always gets stored in a blockfile and not as a separate file. Never say never, and metadata could potentially be bigger than 16K, and then the diskCache code would fails miserably because the map file is closed.
So, either fix the line to close the correct file, or remove the metadata as separate file for cache entries. The first is most simple and correct, the second reduces codesize (and dangers of unused/untested code) but adds a limit to metadata size of cacheEntries.
P.s., not tested, but can someone enforce to have very big cacheEntry metadata and then so force the diskCache to crash?
Assignee | ||
Comment 1•19 years ago
|
||
Attachment #231063 -
Flags: review?(darin)
Comment 2•19 years ago
|
||
Comment on attachment 231063 [details] [diff] [review]
Fix to close the correct file handle
wow, r=darin
Attachment #231063 -
Flags: review?(darin) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #231063 -
Flags: superreview?(bzbarsky)
![]() |
||
Updated•19 years ago
|
Attachment #231063 -
Flags: superreview?(bzbarsky) → superreview+
![]() |
||
Updated•19 years ago
|
Assignee: nobody → alfredkayser
![]() |
||
Comment 3•19 years ago
|
||
Fixed on trunk. Do we need this on the 1.8 branch?
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 4•19 years ago
|
||
I think so, because this could potentially be a DOS issue.
Assignee | ||
Updated•16 years ago
|
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•