aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2019-12-23 21:19:02 -0500
committerrsiddharth <s@ricketyspace.net>2020-04-17 20:56:36 -0400
commitd1e7a3a05bedb507275ee7ca24b6b3bd2325e782 (patch)
treebeabd7840646467ca2d9edf11f3e45662f87477a
parent6bcfae5258b5731a8f5ead9ef39e68a3c2b5320e (diff)
downloadnserver-d1e7a3a05bedb507275ee7ca24b6b3bd2325e782.tar.gz
nserver-d1e7a3a05bedb507275ee7ca24b6b3bd2325e782.tar.bz2
nserver-d1e7a3a05bedb507275ee7ca24b6b3bd2325e782.tar.xz
nserver-d1e7a3a05bedb507275ee7ca24b6b3bd2325e782.zip
nserver/src/ncmd.c: Update process.
* nserver/src/ncmd.c (process): Add cmd check via check_cmd.
-rw-r--r--nserver/src/ncmd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/nserver/src/ncmd.c b/nserver/src/ncmd.c
index 3a20db2..59b2d70 100644
--- a/nserver/src/ncmd.c
+++ b/nserver/src/ncmd.c
@@ -283,6 +283,11 @@ int call_function(int func, struct bstrList *cmd_parts, char *out)
int process(char *cmd, char *out)
{
+ check(out, "out invalid");
+
+ int rc = check_cmd(cmd, out);
+ check(rc == 0, "cmd check failed");
+
// split cmd into parts.
struct bstrList *parts = cmd_parts(cmd);
check(parts != NULL, "cmd_parts failed");
@@ -293,7 +298,7 @@ int process(char *cmd, char *out)
check(FUNC != -1, "find function failed");
// call call_function
- int rc = call_function(FUNC, parts, out);
+ rc = call_function(FUNC, parts, out);
check(rc != -1, "call function failed");
return 0;