Closed
Bug 389712
Opened 17 years ago
Closed 17 years ago
PL_GetNextOpt can return an invalid argv pointer
Categories
(NSPR :: NSPR, defect)
Tracking
(Not tracked)
RESOLVED
INVALID
People
(Reporter: neil.williams, Assigned: wtc)
References
()
Details
Under certain conditions PL_GetNextOpt returns argv[argc] as an option value. See bug #346354 for details. This happens when the last option on the command line requires a value. A reasonable fix would be to explicitly return a NULL value rather making this case an error.
Comment 1•17 years ago
|
||
Wan-Teh and I have discussed this at length in bug 346354. He's provided evidence that argv[argc] is NULL, at least in some definitions. http://www.opengroup.org/onlinepubs/000095399/functions/exec.html I guess the question is: are there any systems that do not conform to that definition?
Updated•17 years ago
|
Assignee | ||
Comment 2•17 years ago
|
||
Neil, this is not a bug. The argv array has argc+1 elements, with the last element, argv[argc], being a NULL pointer. So it is fine to use argv[argc] and assume that it is NULL. I believe this convention comes from Unix and was adopted by the C Standard.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•