Closed
Bug 28950
Opened 25 years ago
Closed 25 years ago
wrong type used in nsHeaderEntry which may cause problem when server send bad URL
Categories
(Core :: Networking, defect, P3)
Core
Networking
Tracking
()
VERIFIED
FIXED
M16
People
(Reporter: ftang, Assigned: gagan)
Details
(Whiteboard: 1d)
I caught this when I tring internet keyword w/ SeaMonkey
35 class nsHeaderEntry : public nsIHTTPHeader
36 {
37 public:
38 // nsISupports methods:
39 NS_DECL_ISUPPORTS
40
41 // nsIHTTPHeader methods:
42 NS_DECL_NSIHTTPHEADER
43
44 nsHeaderEntry(nsIAtom* aHeaderAtom, const char* aValue);
45 virtual ~nsHeaderEntry();
46
47 nsCOMPtr<nsIAtom> mAtom;
48 nsString mValue;
49 };
suggest change. Change the line 48 nsString mValue to nsCString
The reason is the value you got from the net is char* not unicode and nsString
use PRUnichar internal but nsCString use char*
nsString have more restrick sematic than nsCString.
In case that server send you non ASCII in the header (they should not, but
currently our keyword server does) we should not cast it to nsString which may
cause unwantted conversion.
more info will be included...
Comment 1•25 years ago
|
||
=> gagan
[Maybe we should eliminate the nsString(char*) constructor in favor of something
with a charset converter that makes us "swear this is ascii". It seems all too
easy to make this mistake.]
Assignee: warren → gagan
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•