Author: cazfi
Date: Tue Sep 22 18:52:15 2015
New Revision: 29951

URL: http://svn.gna.org/viewcvs/freeciv?rev=29951&view=rev
Log:
Fix server crash when a command with too many tokens is given.

Reported by Andreas Røsdal <andreasr>

See bug #23887

Modified:
    trunk/utility/shared.c

Modified: trunk/utility/shared.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/utility/shared.c?rev=29951&r1=29950&r2=29951&view=diff
==============================================================================
--- trunk/utility/shared.c      (original)
+++ trunk/utility/shared.c      Tue Sep 22 18:52:15 2015
@@ -298,7 +298,7 @@
 
   fc_assert_ret_val(NULL != str, -1);
 
-  for (token = 0; token <= num_tokens && *str != '\0'; token++) {
+  for (token = 0; token < num_tokens && *str != '\0'; token++) {
     size_t len, padlength = 0;
 
     /* skip leading delimiters */


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to