Closed
Bug 794636
Opened 12 years ago
Closed 12 years ago
CERT_AsciiToName should take a const char * input argument
Categories
(NSS :: Libraries, defect, P2)
NSS
Libraries
Tracking
(Not tracked)
RESOLVED
FIXED
3.14
People
(Reporter: wtc, Assigned: wtc)
Details
Attachments
(1 file)
2.72 KB,
patch
|
KaiE
:
review+
|
Details | Diff | Splinter Review |
CERT_AsciiToName takes a char * input argument, but it does not modify that string. The input argument should be declared as const char *. This means it is safe to cast away the const to work around this bug.
Attachment #665136 -
Flags: review?(kaie)
Comment 1•12 years ago
|
||
> This means it is safe to cast away the const to work around
> this bug.
I don't understand what you refer to.
In your patch you don't "cast away const" anywhere.
Comment 2•12 years ago
|
||
Comment on attachment 665136 [details] [diff] [review] Proposed patch r=kaie
Attachment #665136 -
Flags: review?(kaie) → review+
Comment 3•12 years ago
|
||
I believe that what Wan-Teh is saying is that if you have a calling function that has a const char *, it is safe to cast away the const to call into this function. However, with this patch that const_cast will become unnecessary.
Assignee | ||
Comment 4•12 years ago
|
||
Eric is right. For example, it is safe to do this: const char* subject_name = "CN=Foo"; CERTName* cert_name = CERT_AsciiToName(const_cast<char*>(subject_name)); Patch checked in on the NSS trunk (NSS 3.14). Checking in alg1485.c; /cvsroot/mozilla/security/nss/lib/certdb/alg1485.c,v <-- alg1485.c new revision: 1.45; previous revision: 1.44 done Checking in cert.h; /cvsroot/mozilla/security/nss/lib/certdb/cert.h,v <-- cert.h new revision: 1.91; previous revision: 1.90 done
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Priority: -- → P2
Resolution: --- → FIXED
Target Milestone: --- → 3.14
You need to log in
before you can comment on or make changes to this bug.
Description
•