[cli] fix ping interval bounds check to avoid Timer::Start() assert (#3531)

This commit is contained in:
Jonathan Hui
2019-01-29 11:54:38 -08:00
committed by GitHub
parent 96076d3aa4
commit 1c2e7033bf
+2 -3
View File
@@ -1939,9 +1939,8 @@ void Interpreter::ProcessPing(int argc, char *argv[])
break;
case 3:
mInterval = static_cast<uint32_t>(value);
VerifyOrExit(mInterval <= Timer::kMaxDt, error = OT_ERROR_INVALID_ARGS);
mInterval = mInterval * 1000;
VerifyOrExit(value <= Timer::kMaxDt / 1000, error = OT_ERROR_INVALID_ARGS);
mInterval = static_cast<uint32_t>(value) * 1000;
break;
default: