mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 02:39:48 +09:00
misc: Fixed ssh_is_ipaddr_v4() on Windows.
(cherry picked from commit eea1df3574)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user