Author: cazfi
Date: Wed Mar 30 14:17:56 2016
New Revision: 32277

URL: http://svn.gna.org/viewcvs/freeciv?rev=32277&view=rev
Log:
Add terminating NULL to the reports sent by new servers to old clients that 
lack 'split_reports'
capability.

Reported by Christian Knoke <chrisk>

See bug #24494

Modified:
    branches/S2_5/server/report.c

Modified: branches/S2_5/server/report.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/server/report.c?rev=32277&r1=32276&r2=32277&view=diff
==============================================================================
--- branches/S2_5/server/report.c       (original)
+++ branches/S2_5/server/report.c       Wed Mar 30 14:17:56 2016
@@ -1574,7 +1574,8 @@
 
   sz_strlcpy(packet_old.caption, caption);
   sz_strlcpy(packet_old.headline, headline);
-  strncpy(packet_old.lines, lines, MIN(MAX_LEN_MSG, strlen(lines)));
+  strncpy(packet_old.lines, lines, MIN(MAX_LEN_MSG, strlen(lines) + 1));
+  packet_old.lines[MAX_LEN_MSG - 1] = '\0';
   packet_old.event = event;
 
   conn_list_iterate(dest, pconn) {


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

Reply via email to