misc: Fixed ssh_is_ipaddr_v4() on Windows.

(cherry picked from commit eea1df3574)
This commit is contained in:
Andreas Schneider
2011-02-13 17:36:45 +01:00
parent 242e1c342c
commit 4f65104ecc
2 changed files with 8 additions and 4 deletions

View File

@@ -158,6 +158,11 @@ int ssh_is_ipaddr_v4(const char *str) {
int sslen = sizeof(ss);
int rc = SOCKET_ERROR;
/* WSAStringToAddressA thinks that 0.0.0 is a valid IP */
if (strlen < 7) {
return 0;
}
rc = WSAStringToAddressA((LPSTR) str,
AF_INET,
NULL,