Open Bug 47476 Opened 25 years ago Updated 3 years ago

nsCID::Parse() accepts invalid CID strings.

Categories

(Core :: XPCOM, defect, P5)

x86
Windows NT
defect

Tracking

()

Future

People

(Reporter: jud, Unassigned)

Details

(Keywords: helpwanted)

If you had Parse() a bogus, inproperly formated string, it will still succeed.
Ray ?
Assignee: dp → rayw
I have been looking through source code trying with no success to find an example of where this call is used. As described, this seems to be a low-priority bug. It only causes a problem if someone passes in an improperly-formatted string. They will probably fail as soon as they try to use the CID. The code in nsID.cpp of the Parse method is checking the length and nothing else to compute the return value. This really should be a programming error, not a run-time error, it seems to me. If this were often-used, it would seem silly for this method to be called passing in a constant, yet checking the return, since the constant never changes. If it is silly to check the return, then it seems silly to even provide the return, unless there is some case where these values are being suplied not as constants. What are some significant use cases that this bug fixes?
I fixed a place that was using it to no longer use it because it's broken.
Can you tell me a bit more about the use case involved? Was it a literal string it was trying to parse, or did the string come from some other source? Also, the bug report mentioned breakage only when the syntax was wrong. Did it not function correctly when the syntax was right, or is wrong syntax a normal part of the operation of this particular use case?
wrong syntax was being passed in, the use case was busted. this bug is just to tell the user when parse() is doing something it doesn't handle well. here's what I ripped out. http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&fi le=nsHTTPHandler.cpp&root=/cvsroot&subdir=mozilla/netwerk/protocol/http/src&comm and=DIFF_FRAMESET&rev1=1.123&rev2=1.124
I agree that the use case is busted, based upon the diff. Thanks, I was just trying to discover any use cases for the method that might require it to be fixed nsbeta3.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Adding verifyme keyword.
Keywords: verifyme
QA Contact: leger → rayw
Edward: Welcome to xpcom!
Status: ASSIGNED → NEW
Target Milestone: Future → mozilla1.0
Once again... attempting to reassign from Ray to Edward.
Assignee: rayw → kandrot
Status: NEW → ASSIGNED
Priority: P3 → P5
reassign all kandrot xpcom bug.
Assignee: kandrot → dougt
Status: ASSIGNED → NEW
Target Milestone: mozilla1.0 → ---
Keywords: helpwanted
Target Milestone: --- → Future
Assignee: dougt → nobody
QA Contact: rayw → xpcom
Keywords: verifyme
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.