Closed
Bug 158830
Opened 22 years ago
Closed 15 years ago
PR_StringToNetAddr("", *ptr) behaviour is inconsistent on windows & solaris
Categories
(NSPR :: NSPR, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
4.8.4
People
(Reporter: gopinath.mr, Assigned: wtc)
References
Details
Attachments
(1 file)
854 bytes,
patch
|
Details | Diff | Splinter Review |
Hi, When the hostname is given as empty string, the inet_address(..) method on solaris returns -1 and on windows it returns 0 (NULL). But the implementation checks for only value -1 and returns PR_FAILURE. So on windows I get PR_SUCCESS and on solaris I get PR_FAILURE. Additional check for return value is NULL has to be added for windows and should return PR_FAILURE. NOTE: The value "0.0.0.0" returns zero on windows, so the only way to check the error is #ifdef WINDOWS if (retValue == 0) { check whether string is empty or contains only space if yes, return PR_FAILURE else // value was 0.0.0.0 } #endifI looked at NSPR implementation in file pr/src/misc/prnetdb.c
Assignee | ||
Updated•22 years ago
|
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Assignee | ||
Comment 1•22 years ago
|
||
I found that inet_addr() behaves the same on Solaris and Windows when the host name string begins with white space. It returns 0 on both platforms. The behavior is only different when the host name is an empty string. On Solaris inet_addr() returns -1 while on Windows it returns 0. I can test for an empty string on Windows and return PR_FAILURE to make the behavior of PR_StringToNetAddr consistent on Solaris and Windows, but it is strange to return 0 on host names that begin with white space, for example, " 10.169.2.10".
Priority: -- → P2
Target Milestone: --- → 4.3
Assignee | ||
Comment 2•22 years ago
|
||
This patch will make the PR_StringToNetAddr("", addr) behaviour consistent on windows and solaris.
Updated•18 years ago
|
QA Contact: wtchang → nspr
Comment 3•17 years ago
|
||
The target milestone is already released. Resetting target milestone.
Target Milestone: 4.3 → ---
Comment 4•15 years ago
|
||
Fixed per bug 344809.
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•15 years ago
|
Target Milestone: --- → 4.8.4
You need to log in
before you can comment on or make changes to this bug.
Description
•