Author: cazfi
Date: Thu Sep 15 06:16:27 2016
New Revision: 33803

URL: http://svn.gna.org/viewcvs/freeciv?rev=33803&view=rev
Log:
Check legality of worker task target received from the client.

See patch #7685

Modified:
    branches/S2_6/server/unithand.c

Modified: branches/S2_6/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/server/unithand.c?rev=33803&r1=33802&r2=33803&view=diff
==============================================================================
--- branches/S2_6/server/unithand.c     (original)
+++ branches/S2_6/server/unithand.c     Thu Sep 15 06:16:27 2016
@@ -3502,7 +3502,12 @@
     ptask->ptile = ptile;
     ptask->act = packet->activity;
     if (packet->tgt >= 0) {
-      ptask->tgt = extra_by_number(packet->tgt);
+      if (packet->tgt < MAX_EXTRA_TYPES) {
+        ptask->tgt = extra_by_number(packet->tgt);
+      } else {
+        log_debug("Illegal worker task target %d", packet->tgt);
+        ptask->tgt = NULL;
+      }
     } else {
       ptask->tgt = NULL;
     }


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

Reply via email to