Mercurial > hg > openttd
changeset 9108:96b59e46923a draft
(svn r12968) -Fix: Don't segfault when adding a server if 0.0.0.0 was entered for the address.
author | maedhros <maedhros@openttd.org> |
---|---|
date | Tue, 06 May 2008 10:31:50 +0000 |
parents | 6e8cfde5fabd |
children | 5d32cf47de94 |
files | src/network/network_udp.cpp |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/network/network_udp.cpp +++ b/src/network/network_udp.cpp @@ -494,6 +494,8 @@ // Clear item in gamelist item = NetworkGameListAddItem(inet_addr(inet_ntoa(out_addr.sin_addr)), ntohs(out_addr.sin_port)); + if (item == NULL) return; + if (StrEmpty(item->info.server_name)) { memset(&item->info, 0, sizeof(item->info)); ttd_strlcpy(item->info.server_name, host, lengthof(item->info.server_name));