home · contact · privacy
Server: Ensure THING_ACTION command fails on argument 0.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 23 Jul 2014 05:34:22 +0000 (07:34 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 23 Jul 2014 05:34:22 +0000 (07:34 +0200)
src/server/god_commands.c

index eee8b1105e22a5c5cfe22c9bdb6b1f6a867eaacc..8bde74235a29e721e7c2afd3dcda2ac7713cafcf 100644 (file)
@@ -159,6 +159,11 @@ static uint8_t parse_thingaction_manipulation(char * tok0, char * tok1)
     }
     else if (parse_val(tok0, tok1, s[S_CMD_THINGACTION], '8', (char *) &id))
     {
+        if (!id)
+        {
+            err_line(1, "Value must be >= 1 and <= 255.");
+            return 1;
+        }
         ta = get_thing_action(id);
         if (!ta)
         {