From 13a59c560b0d5b89e02660a63d5e6307540b13f6 Mon Sep 17 00:00:00 2001
From: Christian Heller <c.heller@plomlompom.de>
Date: Wed, 23 Jul 2014 07:34:22 +0200
Subject: [PATCH] Server: Ensure THING_ACTION command fails on argument 0.

---
 src/server/god_commands.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/server/god_commands.c b/src/server/god_commands.c
index eee8b11..8bde742 100644
--- a/src/server/god_commands.c
+++ b/src/server/god_commands.c
@@ -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)
         {
-- 
2.30.2