Closed Bug 264825 Opened 20 years ago Closed 20 years ago

"save target as" crashes if host unavailable [@ nsHttpHeaderArray::LookupEntry(nsHttpAtom, nsHttpHeaderArray::nsEntry**)()] [@ nsVoidArray::Count()]

Categories

(Core :: Networking: HTTP, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha5

People

(Reporter: Biesinger, Assigned: bzbarsky)

References

(Blocks 1 open bug, )

Details

(Keywords: crash, regression)

Crash Data

Attachments

(2 files)

this is because nsHttpChannel::GetContentEncodings unconditionally accesses
mResponseHead, which can be null - for example, if the host does not exist.

try the url field from this bug (this crashes for me; it may need to have a
192.168.1.x network set up. no web server must be running on that server)


Filing this on networking, because VisitResponseHeaders _does_ nullcheck
mResponseHead before dereferencing it, so I suspect this is a bug in
GetContentEncodings. feel free to reassign to file handling if accessing
contentEncodings on a failed channel is not allowed.

in httpchannel, this would probably be as simple as adding an if
(!mResponseHead) return NS_ERROR_NOT_AVAILABLE; to GetContentEncodings.

this was caused by Bug 160454 I'm sure.
Blocks: 160454
No longer depends on: 160454
Summary: "save target as" crashes if host unavailable → "save target as" crashes if host unavailable [@ nsHttpHeaderArray::LookupEntry(nsHttpAtom, nsHttpHeaderArray::nsEntry**)()] [@ nsVoidArray::Count()]
This is a bug in GetContentEncodings, yes.
Attached patch PatchSplinter Review
Attachment #162513 - Flags: superreview?(darin)
Attachment #162513 - Flags: review?(cbiesinger)
Comment on attachment 162513 [details] [diff] [review]
Patch

ok; I guess if we have no headers at all, we don't have a content-encoding one
either ;) and so returning null matches the docs.
Attachment #162513 - Flags: review?(cbiesinger) → review+
Yes, that was my reasoning.  ;)
Attachment #162513 - Flags: superreview?(darin) → superreview+
Assignee: darin → bzbarsky
Priority: -- → P1
Target Milestone: --- → mozilla1.8alpha5
Fixed.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Severity: major → critical
Blocks: 141764
Ok, it doesn't crash anymore with a 2004-10-19 Seamonkey build.
But now a file picker opens up with "U RL.htm" as suggested file name. When
trying to save the file, the download manager tries to download it, and very
misleadingly says after a while it was downloaded, when in fact it wasn't
downloaded.
But maybe that is what bug 174167 is about?
Yes, that's bug 174167
Crash Signature: [@ nsHttpHeaderArray::LookupEntry(nsHttpAtom, nsHttpHeaderArray::nsEntry**)()] [@ nsVoidArray::Count()]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: