[cli] validate prefix add/remove argument count (#3505)

This commit is contained in:
Jonathan Hui
2019-01-24 09:04:38 -08:00
committed by GitHub
parent c2a10ec446
commit ce3c712fe6
+4
View File
@@ -2120,6 +2120,8 @@ otError Interpreter::ProcessPrefixAdd(int argc, char *argv[])
otBorderRouterConfig config;
int argcur = 0;
VerifyOrExit(argc > 0, error = OT_ERROR_INVALID_ARGS);
memset(&config, 0, sizeof(otBorderRouterConfig));
char *prefixLengthStr;
@@ -2212,6 +2214,8 @@ otError Interpreter::ProcessPrefixRemove(int argc, char *argv[])
struct otIp6Prefix prefix;
int argcur = 0;
VerifyOrExit(argc > 0, error = OT_ERROR_INVALID_ARGS);
memset(&prefix, 0, sizeof(otIp6Prefix));
char *prefixLengthStr;