version 1.59, 2007/05/14 20:19:23
|
version 1.60, 2007/05/25 16:18:53
|
|
|
if (hostname[i] == ':') | if (hostname[i] == ':') |
{ | { |
i++; | i++; |
|
// First check that there is at least one digit specified for the |
|
// port number if the ':' delimiter is present. Note that there is |
|
// a question as to whether ':' can exist without the port number. |
|
// ATTN: See bug 6424. |
if (!(isascii(hostname[i]) && isdigit(hostname[i]))) | if (!(isascii(hostname[i]) && isdigit(hostname[i]))) |
{ | { |
return false; | return false; |
} | } |
|
|
|
Uint32 port = (hostname[i] - '0'); |
i++; | i++; |
| |
|
// Check that remaining characters in port number are all digits, |
|
// and that the port number can be represented by 16-bits. |
while (isascii(hostname[i]) && isdigit(hostname[i])) | while (isascii(hostname[i]) && isdigit(hostname[i])) |
{ | { |
|
port = port*10 + (hostname[i] - '0'); |
|
if(port > 65535) |
|
{ |
|
return false; |
|
} |
i++; | i++; |
} | } |
} | } |