Closed
Bug 163225
Opened 22 years ago
Closed 22 years ago
success or failure of ExtractScheme is not enough to decide if a url is absolute or relative
Categories
(Core :: Networking, defect, P3)
Core
Networking
Tracking
()
VERIFIED
FIXED
mozilla1.2alpha
People
(Reporter: andreas.otte, Assigned: andreas.otte)
References
Details
Attachments
(1 file, 4 obsolete files)
1.80 KB,
patch
|
bbaetz
:
review+
darin.moz
:
superreview+
jesup
:
approval+
|
Details | Diff | Splinter Review |
Success or failure of ExtractScheme is not enough to decide if an url is absolute or relative after checkin of patch of bug 32966
Assignee | ||
Comment 1•22 years ago
|
||
Current NewURI functions use ExtractScheme to decide if an url is absolute or relative. It is not so easy anymore ... leave that decision to ::Resolve.
Assignee | ||
Comment 2•22 years ago
|
||
Assignee | ||
Updated•22 years ago
|
Priority: -- → P3
Target Milestone: --- → mozilla1.2alpha
Comment 3•22 years ago
|
||
+ if (!NS_SUCCEEDED(rv)) { use if (NS_FAILED(rv))
Assignee | ||
Comment 4•22 years ago
|
||
incorporating cbiesingers suggestion
Assignee | ||
Updated•22 years ago
|
Attachment #95703 -
Attachment is obsolete: true
Assignee | ||
Comment 5•22 years ago
|
||
this version checks in nsStandardURL::Init before calling resolve to reduce the costs of removing the check in nsIOService.cpp. Thanks Darin!
Attachment #95706 -
Attachment is obsolete: true
Comment 7•22 years ago
|
||
Comment on attachment 96687 [details] [diff] [review] better performing patch > >+ if (baseURI) { >+ PRUint32 start, end; >+ // pull out the scheme and where it ends >+ nsresult rv = ExtractURLScheme(spec, &start, &end, nsnull); >+ if (NS_SUCCEEDED(rv)) { >+ nsACString::const_iterator slash; >+ spec.BeginReading(slash); >+ slash.advance(end); >+ // then check if // follows >+ // if it follows aSpec is really absolute ... >+ // ignore aBaseURI in this case >+ if (*slash == '/' && *(++slash) == '/') Do you need to check for urls like |http:/|, where this will run of the end of the string? r=bbaetz if those invalid urls have been rejected by then.
Attachment #96687 -
Flags: review+
Comment 8•22 years ago
|
||
Comment on attachment 96687 [details] [diff] [review] better performing patch andreas: i think bbaetz is right... we will have to add an additional length check in there. either compare slash to EndReading, or check (spec.Length() > end+1)??
Attachment #96687 -
Flags: superreview+
Assignee | ||
Comment 9•22 years ago
|
||
please move forward r= ans sr=
Attachment #96687 -
Attachment is obsolete: true
Assignee | ||
Comment 10•22 years ago
|
||
There are two calls to resource urls during startup which are not stopped by this new check in ::Init and get only resolved as absolute urls by ::Resolve. I think that is acceptable.
Comment 11•22 years ago
|
||
Comment on attachment 96911 [details] [diff] [review] patch with length check >Index: mozilla/netwerk/base/src/nsStandardURL.cpp >+ if (baseURI) { >+ PRUint32 start, end; >+ // pull out the scheme and where it ends >+ nsresult rv = ExtractURLScheme(spec, &start, &end, nsnull); >+ if (NS_SUCCEEDED(rv)) { i think the spec.Length() check should appear here instead: if (NS_SUCCEEDED(rv) && (spec.Length() > end+1)) {
Attachment #96911 -
Flags: needs-work+
Assignee | ||
Comment 12•22 years ago
|
||
yes, this is better, this will save even more time
Assignee | ||
Updated•22 years ago
|
Attachment #96911 -
Attachment is obsolete: true
Comment 13•22 years ago
|
||
Comment on attachment 96916 [details] [diff] [review] patch with moved length check sr=darin nit: "if it follows, aSpec is really absolute" need a comma after follows :)
Attachment #96916 -
Flags: superreview+
Assignee | ||
Comment 14•22 years ago
|
||
Done in my file, but I wont attach another patch for that ... Bradley could you move your r= to the current patch?
Comment 15•22 years ago
|
||
Comment on attachment 96916 [details] [diff] [review] patch with moved length check r=bbaetz
Attachment #96916 -
Flags: review+
Assignee | ||
Comment 16•22 years ago
|
||
fix is in
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 17•22 years ago
|
||
*** Bug 165579 has been marked as a duplicate of this bug. ***
Assignee | ||
Updated•22 years ago
|
Keywords: mozilla1.0.1
Comment 18•22 years ago
|
||
Comment on attachment 96916 [details] [diff] [review] patch with moved length check a=rjesup@wgate.com for 1.0 branch checkin Change mozilla1.0.2+ to fixed1.0.2 when checked in.
Attachment #96916 -
Flags: approval+
Updated•22 years ago
|
Keywords: mozilla1.0.1 → mozilla1.0.2+
Assignee | ||
Updated•22 years ago
|
Keywords: mozilla1.0.2+ → fixed1.0.2
Comment 19•22 years ago
|
||
This caused regressions bug 166085 and bug 166175
Comment 20•22 years ago
|
||
Please verify the bug. Once verified, change the keyword fixed1.0.2 to verified1.0.2
Comment 21•22 years ago
|
||
Hi, can someone give me a test or some steps?
Comment 22•22 years ago
|
||
Checked using lxr and the patch is checked in on both the trunk and branch. verified.
Status: RESOLVED → VERIFIED
Keywords: fixed1.0.2 → verified1.0.2
You need to log in
before you can comment on or make changes to this bug.
Description
•