From 31ca0ce052bf5e26bcbb3fc197eb5e4794cb38c8 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 2 Jul 2015 13:42:15 +0200 Subject: [PATCH] fix a parser crash in the USE command. --- src/laws.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/laws.c b/src/laws.c index 40d224e7f..f85c8c063 100755 --- a/src/laws.c +++ b/src/laws.c @@ -3772,6 +3772,10 @@ int use_cmd(unit * u, struct order *ord) init_order(ord); t = gettoken(token, sizeof(token)); + if (!t) { + cmistake(u, ord, 43, MSG_PRODUCE); + return err; + } n = atoi((const char *)t); if (n == 0) { if (isparam(t, u->faction->locale, P_ANY)) {