Closed Bug 39058 Opened 25 years ago Closed 20 years ago

Check char* version of mozTXTToHTMLConv for potential mem access violations

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME
Future

People

(Reporter: BenB, Assigned: mscott)

References

Details

(Whiteboard: [nsbeta3-])

I wrote mozTXTToHTMLConv in the assumption, that strings are nsStrings, which do checks on its own. It seems like the class has been converted to char*s without taking this into account. I found per accident one instance of this: <quote src="http://lxr.mozilla.org/seamonkey/source/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp#847"> for (; PRInt32(i) < lineLength && nsCRT::IsAsciiAlpha(line[i]); i++) ; if (line[i] == '>' || line[i] == ']') </quote> With the new string implementations, we propably don't need char*s. If I understood it right, there'll be an implementation, which can handle usage of |Right()| very well. Maybe, you're lucky and I'll fix bug 30232 "Remove char*s from mozTXTToHTMLConv", so you don't need to fix this bug (and others in the current tree).
Ben, what do you mean by "nsStrings, which do checks on its own". I wasn't sure what checks you were assuming nsString made.
I don't need to make the usual pointer checks with nsString. I'm not sure I can list the concrete cases. Certainly existance of a string and running over boundaries (e.g. |hello[x]| with |x > hello.Length()|).
Status: NEW → ASSIGNED
Keywords: nsbeta3
Target Milestone: --- → M20
Future'ing. I did some brief code inspection a while ago and didn't see anything. We don't see anything abnormal in the purify logs either.
Whiteboard: [nsbeta3-]
Target Milestone: M20 → Future
mass move, v2. qa to me.
QA Contact: tever → benc
Blocks: 116842
marking WORKSFORME based on how old this bug is and comment #3. please reopen if i'm mistaken.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.