-1 passed where unsigned is required

VERIFIED FIXED in M12

Status

()

Core
Networking
P3
normal
VERIFIED FIXED
19 years ago
18 years ago

People

(Reporter: Colin Blake, Assigned: Gagan)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

19 years ago
In netwerk/base/src/nsStdURL.cpp is the following line of code (twice):

  ExtractString(mSpec, &mHost, -1, -1);

The function ExtractString has the third and fourth args defined as
UNsigned, so I have no idea what's happening when -1 gets passed in.

Colin.

Updated

19 years ago
Target Milestone: M12

Updated

19 years ago
Blocks: 13449

Comment 1

19 years ago
The intention here is to clear mHost. I think 0, 0 should be passed. The
arguments in question are pos and length and ExtractString will abort after
freeing the destination if length == 0. I will do some tests.

Comment 2

19 years ago
The intention here is to clear mHost. I think 0, 0 should be passed. The
arguments in question are pos and length and ExtractString will abort after
freeing the destination if length == 0. I will do some tests.

Comment 3

19 years ago
Created attachment 2215 [details] [diff] [review]
easy patch to fix the bug. Please review.
(Reporter)

Comment 4

19 years ago
I don't believe I'm qualified to review this fix. You're not asking me to
review the fix, right?

Comment 5

19 years ago
I think you can do that. Just look what happens when ExtractString is called
with 0,0 instead of -1,-1. The purpose is to clean out the string. But gagan
should have the final call ...
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 6

19 years ago
Actually I just fixed this (still sitting in my tree) the call really needed to
be replaced by CRTFREEIF(mHost) which will clear it. Sorry it took me this long
to get to this bug.
(Assignee)

Updated

19 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED

Comment 7

19 years ago
Bulk move of all Necko (to be deleted component) bugs to new Networking

component.

Updated

18 years ago
Status: RESOLVED → VERIFIED

Comment 8

18 years ago
verified
You need to log in before you can comment on or make changes to this bug.