mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
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)
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user