FWGS / xash3d

DEPRECATED in favor of https://github.com/FWGS/xash3d-fwgs. Only bugfixes are accepted.
https://xash.su
GNU General Public License v3.0
551 stars 107 forks source link

Incorrect check for local server. #325

Open nekonomicon opened 6 years ago

nekonomicon commented 6 years ago

This check not working if local server has another hostname and such behavior can cause crashes in some cases.

a1batross commented 6 years ago

localhost name is a part of RFC. Who is crazy enough to have DNS implementation, which will NOT point .localhost to 127.0.0.1?

nekonomicon commented 6 years ago

Any linux or *BSD user can rename localhost to dogy or . as example. Maybe exists another solution to check it?

a1batross commented 6 years ago

And localhost will still point to local host.

The only bug I see here is calling NET_StringToAdr with hostname, which will result a netadr_t filled with local address, but wrong type. But it does not seems to be critical.

nekonomicon commented 6 years ago

Just valgrind wrote about uninitialized value: https://pastebin.com/9sAE0VHL I think reason in hostname. May be it's false positive, but not reproducible when my hostname - localhost.