Closed
Bug 18520
Opened 26 years ago
Closed 26 years ago
prmapopt.c:_PR_MapOptionName is incorrect
Categories
(NSPR :: NSPR, defect, P3)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: wtc, Assigned: wtc)
Details
The function _PR_MapOptionName in prmapopt.c has a bug.
The code that checks whether the first argument 'optname'
is a valid PRSockOption enumeration constant is wrong.
It is:
if ((optname < PR_SockOpt_Linger)
&& (optname > PR_SockOpt_MaxSegment))
{
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return PR_FAILURE;
}
It should be:
if ((optname < PR_SockOpt_Linger)
|| (optname >= PR_SockOpt_Last))
{
PR_SetError(PR_INVALID_ARGUMENT_ERROR, 0);
return PR_FAILURE;
}
Note && should be || and PR_SockOpt_Last is
used so that the code won't be broken when a new
socket option is added.
| Assignee | ||
Updated•26 years ago
|
Status: NEW → ASSIGNED
| Assignee | ||
Updated•26 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 26 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 1•26 years ago
|
||
The fix is checked in.
/cvsroot/mozilla/nsprpub/pr/src/io/prmapopt.c, revision 3.12
/m/src/ns/nspr20/pr/src/io/prmapopt.c, revision 2.10
| Comment hidden (collapsed) |
You need to log in
before you can comment on or make changes to this bug.
Description
•