From 8f25db11cccf280f2bd27d2d4085468552db0f18 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Sat, 3 Nov 2018 08:09:14 -0700 Subject: [PATCH] [coap] fix header length calculation overflow error (#3260) Credit to OSS-Fuzz. --- src/core/coap/coap_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/coap/coap_header.cpp b/src/core/coap/coap_header.cpp index 4114480ae..9ae90e6a9 100644 --- a/src/core/coap/coap_header.cpp +++ b/src/core/coap/coap_header.cpp @@ -170,7 +170,7 @@ otError Header::FromMessage(const Message &aMessage, uint16_t aMetadataSize) VerifyOrExit(mHeaderLength + optionLength <= length); aMessage.Read(offset, optionLength, mHeader.mBytes + mHeaderLength); - mHeaderLength += static_cast(optionLength); + mHeaderLength += optionLength; offset += optionLength; }