From: Martin Schwenke Date: Fri, 7 Jun 2019 20:56:00 +0000 (+1000) Subject: ctdb-cluster-mutex: Ensure that the configured command is not empty X-Git-Tag: samba-4.11.0rc1~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c24d434b9610e2865f8288e8046588cd8c551e6;p=thirdparty%2Fsamba.git ctdb-cluster-mutex: Ensure that the configured command is not empty ... and does not just contain whitespace. Otherwise NULL can be passed as the first argument to execv(). Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/server/ctdb_cluster_mutex.c b/ctdb/server/ctdb_cluster_mutex.c index 2e3cb8112ad..719b5c14f7a 100644 --- a/ctdb/server/ctdb_cluster_mutex.c +++ b/ctdb/server/ctdb_cluster_mutex.c @@ -176,6 +176,10 @@ static bool cluster_mutex_helper_args_cmd(TALLOC_CTX *mem_ctx, return false; } n = strv_count(strv); + if (n == 0) { + D_ERR("Mutex helper command is empty \"%s\"\n", argstring); + return false; + } /* Extra slot for NULL */ args = talloc_array(mem_ctx, char *, n + 1);