[dns-client] validate response timeout <= TimerMilli::kMaxDelay (#8275)

This commit is contained in:
Jonathan Hui
2022-10-13 08:37:22 -07:00
committed by GitHub
parent f459d9e333
commit f92364c977
+4
View File
@@ -738,6 +738,10 @@ Error Client::AllocateQuery(const QueryInfo &aInfo, const char *aLabel, const ch
{
Error error = kErrorNone;
aQuery = nullptr;
VerifyOrExit(aInfo.mConfig.GetResponseTimeout() <= TimerMilli::kMaxDelay, error = kErrorInvalidArgs);
aQuery = Get<MessagePool>().Allocate(Message::kTypeOther);
VerifyOrExit(aQuery != nullptr, error = kErrorNoBufs);