diff options
author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-11-18 14:54:40 +0100 |
---|---|---|
committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-11-18 14:54:40 +0100 |
commit | 1ef9e9ef6abc8070f5259f11a79c352580e45049 (patch) | |
tree | 3e2f09978d4cdaa452f355b9206f6c6b2de8733c /core/io | |
parent | 35b421b6954c5baff4b4fd4bc56b09c85dae6ff5 (diff) |
Properly accept wildcard when binding IPv4 socket.
Also never return null for is_ipv4 to avoid crashes due to engine bug.
(better to get an error and a broken socket then seeing your game crash)
Diffstat (limited to 'core/io')
-rw-r--r-- | core/io/ip_address.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/io/ip_address.cpp b/core/io/ip_address.cpp index 6d979d10eb..194d1af6bf 100644 --- a/core/io/ip_address.cpp +++ b/core/io/ip_address.cpp @@ -184,7 +184,7 @@ bool IP_Address::is_ipv4() const { } const uint8_t *IP_Address::get_ipv4() const { - ERR_FAIL_COND_V(!is_ipv4(), 0); + ERR_FAIL_COND_V(!is_ipv4(), &(field8[12])); // Not the correct IPv4 (it's an IPv6), but we don't want to return a null pointer risking an engine crash. return &(field8[12]); } |