Closed Bug 1161240 Opened 5 years ago Closed 5 years ago

Make sure that NS_CloneInputStream correctly deals with null input

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: ehsan, Assigned: ehsan)

Details

Attachments

(1 file)

No description provided.
Attachment #8601104 - Flags: review?(nfroyd) → review+
Comment on attachment 8601104 [details] [diff] [review]
Make sure that NS_CloneInputStream correctly deals with null input

Review of attachment 8601104 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/io/nsStreamUtils.cpp
@@ +854,5 @@
>                      nsIInputStream** aReplacementOut)
>  {
> +  if (NS_WARN_IF(!aSource)) {
> +    return NS_ERROR_FAILURE;
> +  }

Personally I would just return NS_OK and leave aCloneOut as nullptr.  That is a valid clone operation of a nullptr source.

Or MOZ_ASSERT(aSource).
https://hg.mozilla.org/mozilla-central/rev/fb28bbd992df
Assignee: nobody → ehsan
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.