From 0cc27dd91d014b44f56dba570656ec4c68d1aafe Mon Sep 17 00:00:00 2001 From: Harry Morris Date: Wed, 15 Feb 2017 17:12:43 +0000 Subject: [PATCH] Gracefully handle invalid linkquality command (#1261) linkquality cli command always expects at least a extended address specifying the link. If no argument is provided then throw an error and exit. --- src/cli/cli.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/cli/cli.cpp b/src/cli/cli.cpp index 712c82716..84fa9ef06 100644 --- a/src/cli/cli.cpp +++ b/src/cli/cli.cpp @@ -1007,6 +1007,7 @@ void Interpreter::ProcessLinkQuality(int argc, char *argv[]) uint8_t linkQuality; long value; + VerifyOrExit(argc > 0, error = kThreadError_InvalidArgs); VerifyOrExit(Hex2Bin(argv[0], extAddress, OT_EXT_ADDRESS_SIZE) >= 0, error = kThreadError_Parse); if (argc == 1)