diff options
author | tron <tron@openttd.org> | 2005-08-28 12:24:57 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-08-28 12:24:57 +0000 |
commit | d975abc96c4eabd4a1053ee21f2b6951779a87c4 (patch) | |
tree | dfedf7a20a1b1bef9337b90678b68de7ec35aa61 /network.c | |
parent | 70c07d13beca606e76d61b546d864a8961578b98 (diff) | |
download | openttd-d975abc96c4eabd4a1053ee21f2b6951779a87c4.tar.xz |
(svn r2899) -Fix: Several format string vulnerabilities and buffer overflows in the network code
Diffstat (limited to 'network.c')
-rw-r--r-- | network.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -100,7 +100,7 @@ void CDECL NetworkTextMessage(NetworkAction action, uint16 color, bool self_send char temp[1024]; va_start(va, str); - vsprintf(buf, str, va); + vsnprintf(buf, lengthof(buf), str, va); va_end(va); switch (action) { @@ -499,7 +499,7 @@ void NetworkCloseClient(NetworkClientState *cs) GetString(str, STR_NETWORK_ERR_CLIENT_GENERAL + errorno); - NetworkTextMessage(NETWORK_ACTION_LEAVE, 1, false, client_name, str); + NetworkTextMessage(NETWORK_ACTION_LEAVE, 1, false, client_name, "%s", str); // Inform other clients of this... strange leaving ;) FOR_ALL_CLIENTS(new_cs) { |