Author: cazfi
Date: Thu Sep 15 06:16:13 2016
New Revision: 33802

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

See patch #7685

Modified:
    trunk/server/unithand.c

Modified: trunk/server/unithand.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/server/unithand.c?rev=33802&r1=33801&r2=33802&view=diff
==============================================================================
--- trunk/server/unithand.c     (original)
+++ trunk/server/unithand.c     Thu Sep 15 06:16:13 2016
@@ -4719,7 +4719,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