From 37f13066b8ed17b7549f8da7a30f1ccd86803f18 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 12 Feb 2015 10:19:24 +0200 Subject: [PATCH] tools/btmgmt: Fix checking for empty arguments list --- tools/btmgmt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/btmgmt.c b/tools/btmgmt.c index 84a5f1b51..49459e3fa 100644 --- a/tools/btmgmt.c +++ b/tools/btmgmt.c @@ -3347,6 +3347,9 @@ static void rl_handler(char *input) if (wordexp(input, &w, WRDE_NOCMD)) goto done; + if (w.we_wordc == 0) + goto free_we; + cmd = w.we_wordv[0]; argv = w.we_wordv; argc = w.we_wordc; -- 2.47.3