Closed
Bug 801483
Opened 13 years ago
Closed 13 years ago
make nsBufferedInputStream::Init fallible
Categories
(Core :: Networking, defect)
Tracking
()
RESOLVED
FIXED
mozilla19
People
(Reporter: m_kato, Assigned: m_kato)
Details
(Keywords: crash)
Crash Data
Attachments
(1 file, 2 obsolete files)
|
4.51 KB,
patch
|
briansmith
:
review+
|
Details | Diff | Splinter Review |
crash id is bp-f7294fd5-e5d4-4c5f-81ea-86b722121012 .
I think that nsIBufferedInputStream.init should return out of memory error if buffer parameter is too big or we cannot allocate memory.
| Assignee | ||
Comment 1•13 years ago
|
||
| Assignee | ||
Updated•13 years ago
|
Attachment #671287 -
Flags: review?(honzab.moz)
Comment 2•13 years ago
|
||
Please change NS_NewBufferedInputStream to have MOZ_WARN_UNUSED_RESULT, and change the callers of NS_NewBufferedInputStream to handle the error correctly and/or forward the correct error code. I noticed three problems:
#1: Will crash because the code assumes NS_NewBufferedInputStream always succeeds:
http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.cpp#8117
#2, #3: Returns the wrong error code:
http://mxr.mozilla.org/mozilla-central/source/netwerk/cache/nsDiskCacheDeviceSQL.cpp#1747
http://mxr.mozilla.org/mozilla-central/source/dom/devicestorage/nsDeviceStorage.cpp#362
| Assignee | ||
Comment 3•13 years ago
|
||
(In reply to Brian Smith (:bsmith) from comment #2)
> Please change NS_NewBufferedInputStream to have MOZ_WARN_UNUSED_RESULT, and
> change the callers of NS_NewBufferedInputStream to handle the error
> correctly and/or forward the correct error code. I noticed three problems:
>
> #1: Will crash because the code assumes NS_NewBufferedInputStream always
> succeeds:
> http://mxr.mozilla.org/mozilla-central/source/layout/base/nsPresShell.
> cpp#8117
>
> #2, #3: Returns the wrong error code:
> http://mxr.mozilla.org/mozilla-central/source/netwerk/cache/
> nsDiskCacheDeviceSQL.cpp#1747
> http://mxr.mozilla.org/mozilla-central/source/dom/devicestorage/
> nsDeviceStorage.cpp#362
OK. I will fix this.
| Assignee | ||
Updated•13 years ago
|
Attachment #671287 -
Flags: review?(honzab.moz)
| Assignee | ||
Comment 4•13 years ago
|
||
Assignee: nobody → m_kato
Attachment #671287 -
Attachment is obsolete: true
| Assignee | ||
Comment 5•13 years ago
|
||
Attachment #671346 -
Attachment is obsolete: true
Attachment #671349 -
Flags: review?(honzab.moz)
Comment 6•13 years ago
|
||
Comment on attachment 671349 [details] [diff] [review]
fix
Review of attachment 671349 [details] [diff] [review]:
-----------------------------------------------------------------
Stealing review because Honza is OOO this week.
Attachment #671349 -
Flags: review?(honzab.moz) → review+
| Assignee | ||
Comment 7•13 years ago
|
||
Target Milestone: --- → mozilla19
Comment 8•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•