Closed
Bug 417637
Opened 18 years ago
Closed 17 years ago
tstclnt crashes if -p option is not specified
Categories
(NSS :: Tools, defect, P3)
NSS
Tools
Tracking
(Not tracked)
RESOLVED
FIXED
3.11.10
People
(Reporter: nelson, Assigned: nelson)
Details
Attachments
(1 file, 1 obsolete file)
2.33 KB,
patch
|
julien.pierre
:
review+
alvolkov.bgs
:
review+
|
Details | Diff | Splinter Review |
If tstclnt is invoked without the -p option, it is supposed to use port 443.
It does that, but then it crashes, because it tries to free a string that
wasn't malloc'ed.
This patch fixes it.
Attachment #303421 -
Flags: superreview?(julien.pierre.boogz)
Attachment #303421 -
Flags: review?(alexei.volkov.bugs)
Comment 1•18 years ago
|
||
Comment on attachment 303421 [details] [diff] [review]
patch v1 (for trunk)
This fixes the leak, but I think the following check is incorrect :
+ if (!host || portno == ((PRUint16)-1))
+ Usage(progName);
That's because atoi will return 0 in failure cases, not -1. And we know port 0 is invalid for sure. So you you should check for
(!host || !portno)
instead.
Attachment #303421 -
Flags: superreview?(julien.pierre.boogz) → superreview-
Assignee | ||
Comment 2•18 years ago
|
||
Thanks, Julien. I was thinking of the function strtol, which I typically use
instead of atoi and atol because it allows input to be hex or octal as well as
decimal.
Attachment #303421 -
Attachment is obsolete: true
Attachment #303762 -
Flags: review?(julien.pierre.boogz)
Attachment #303421 -
Flags: review?(alexei.volkov.bugs)
Updated•18 years ago
|
Attachment #303762 -
Flags: review?(julien.pierre.boogz) → review+
Assignee | ||
Comment 3•18 years ago
|
||
Checking in tstclnt.c; new revision: 1.49; previous revision: 1.48
Priority: -- → P3
Assignee | ||
Comment 4•18 years ago
|
||
Comment on attachment 303762 [details] [diff] [review]
patch v2
requesting second review for branch.
Attachment #303762 -
Flags: review?(alexei.volkov.bugs)
Updated•17 years ago
|
Attachment #303762 -
Flags: review?(alexei.volkov.bugs) → review+
Assignee | ||
Comment 5•17 years ago
|
||
tstclnt.c; new revision: 1.42.2.5; previous revision: 1.42.2.4
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•