From 2d94337e1ac754f6181d537708fe3a187d2c7400 Mon Sep 17 00:00:00 2001 From: rubidium Date: Wed, 13 Aug 2008 06:22:04 +0000 Subject: (svn r14064) -Fix [FS#1752]: check for the length of strings (in bytes) in the command. Checking for the length in pixels is impossible because that differs per client. --- src/signs.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/signs.cpp') diff --git a/src/signs.cpp b/src/signs.cpp index 369295a60..b514e2ab1 100644 --- a/src/signs.cpp +++ b/src/signs.cpp @@ -133,6 +133,8 @@ CommandCost CmdRenameSign(TileIndex tile, uint32 flags, uint32 p1, uint32 p2) /* If _cmd_text 0 means the new text for the sign is non-empty. * So rename the sign. If it is empty, it has no name, so delete it */ if (!StrEmpty(_cmd_text)) { + if (strlen(_cmd_text) >= MAX_LENGTH_SIGN_NAME_BYTES) return CMD_ERROR; + if (flags & DC_EXEC) { Sign *si = GetSign(p1); -- cgit v1.2.3-54-g00ecf