summaryrefslogtreecommitdiff
path: root/network.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-08-28 12:24:57 +0000
committertron <tron@openttd.org>2005-08-28 12:24:57 +0000
commitd975abc96c4eabd4a1053ee21f2b6951779a87c4 (patch)
treedfedf7a20a1b1bef9337b90678b68de7ec35aa61 /network.c
parent70c07d13beca606e76d61b546d864a8961578b98 (diff)
downloadopenttd-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/network.c b/network.c
index a16d95b1c..6143c7925 100644
--- a/network.c
+++ b/network.c
@@ -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) {