From: Alan T. DeKok Date: Wed, 1 Aug 2018 19:46:51 +0000 (-0400) Subject: better commands X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b430d8d48f41fe8b43af4b0d2ef3d2d50593b413;p=thirdparty%2Ffreeradius-server.git better commands --- diff --git a/src/lib/server/command.c b/src/lib/server/command.c index 67ceb44301f..14011518db4 100644 --- a/src/lib/server/command.c +++ b/src/lib/server/command.c @@ -1964,8 +1964,19 @@ int fr_command_str_to_argv(fr_cmd_t *head, fr_cmd_info_t *info, char const *text char const *word, *p, *q; fr_cmd_t *cmd; - if ((info->argc < 0) || (info->max_argc <= 0) || !text || !head) { - fr_strerror_printf("Invalid arguments passed to parse routine."); + if ((info->argc < 0) || (info->max_argc <= 0)) { + fr_strerror_printf("argc / max_argc must be greater than zero"); + return -1; + } + + if (!text) { + fr_strerror_printf("No string to split."); + return -1; + } + + + if (!head) { + fr_strerror_printf("No commands to run."); return -1; }