mirror of
https://github.com/espressif/openthread.git
synced 2026-08-23 18:59:51 +00:00
[coap] allow max URI path length (#5645)
- allow max URI path length of 32 - change error to OT_ERROR_PARSE (used to be OT_ERROR_NOT_FOUND)
This commit is contained in:
@@ -666,7 +666,7 @@ exit:
|
||||
|
||||
void CoapBase::ProcessReceivedRequest(Message &aMessage, const Ip6::MessageInfo &aMessageInfo)
|
||||
{
|
||||
char uriPath[Resource::kMaxReceivedUriPath];
|
||||
char uriPath[Resource::kMaxReceivedUriPath + 1];
|
||||
char * curUriPath = uriPath;
|
||||
Message * cachedResponse = nullptr;
|
||||
otError error = OT_ERROR_NOT_FOUND;
|
||||
@@ -704,7 +704,7 @@ void CoapBase::ProcessReceivedRequest(Message &aMessage, const Ip6::MessageInfo
|
||||
*curUriPath++ = '/';
|
||||
}
|
||||
|
||||
VerifyOrExit(curUriPath + optionLength < OT_ARRAY_END(uriPath), OT_NOOP);
|
||||
VerifyOrExit(curUriPath + optionLength < OT_ARRAY_END(uriPath), error = OT_ERROR_PARSE);
|
||||
|
||||
IgnoreError(iterator.ReadOptionValue(curUriPath));
|
||||
curUriPath += optionLength;
|
||||
|
||||
Reference in New Issue
Block a user