Closed Bug 122787 Opened 23 years ago Closed 23 years ago

(nsIURI) nsStandardURL::SetFileName doesn't recalculate mPath

Categories

(Core :: Networking, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla0.9.9

People

(Reporter: Brade, Assigned: darin.moz)

Details

Attachments

(1 file, 1 obsolete file)

For publishing, I came across this interesting bug. For publishing we create an nsIURI with an url that doesn't have the file extension. The extension is added later. When the code calls nsStandardURL::SetFileName to set the name with the extension, everything is reset except mPath which is left as the path without the extension. During publishing, the HTTP put tries to GetPath but it doesn't get the whole path. Regardless, this seems like it could be a pretty serious problem (if someone SetFileName to "" or something less than what was there. I have a fix in my own tree but I'm not an expert in this area so I'd like some idea of the right approach (manually fix the mLen for mPath or call some other method to do the recalculation).
brade: can you please provide some sample code that would demonstrate the problem? thx!
ok, i have a way to repro the problem -> 0.9.9 critical
Severity: major → critical
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla0.9.9
Attached patch v1.0 patch (obsolete) — Splinter Review
verified this patch using xpcshell... url.spec = "http://foo.com/bar/baz" url.fileName = "baz.html" then i checked all of the nsIURI/nsIURL attributes and didn't see any problems.
Attached patch v1.1 patchSplinter Review
revised per comments from brade
Attachment #67285 - Attachment is obsolete: true
Comment on attachment 67298 [details] [diff] [review] v1.1 patch r=dougt
Attachment #67298 - Flags: review+
Comment on attachment 67298 [details] [diff] [review] v1.1 patch sr=mscott
Attachment #67298 - Flags: superreview+
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: