void Server::HandleUdpReceive(Message &aMessage, const Ip6::MessageInfo &aMessageInfo) { Header header; char uriPath[kMaxReceivedUriPath]; char *curUriPath = uriPath; const Header::Option *coapOption; SuccessOrExit(header.FromMessage(aMessage)); aMessage.MoveOffset(header.GetLength()); coapOption = header.GetCurrentOption(); while (coapOption != NULL) { switch (coapOption->mNumber) { case kCoapOptionUriPath: VerifyOrExit(coapOption->mLength < sizeof(uriPath) - static_cast<size_t>(curUriPath - uriPath), ;); memcpy(curUriPath, coapOption->mValue, coapOption->mLength); curUriPath[coapOption->mLength] = '/'; curUriPath += coapOption->mLength + 1; break; case kCoapOptionContentFormat: break; default: ExitNow(); } coapOption = header.GetNextOption(); }