[qos] check frame length when reading UDP header (#3298)

Credit to OSS-Fuzz.
This commit is contained in:
Jonathan Hui
2018-11-14 17:31:29 -08:00
committed by GitHub
parent 33b0ee9330
commit bf72fd8f8d
+1
View File
@@ -1583,6 +1583,7 @@ otError MeshForwarder::GetFramePriority(uint8_t * aFrame,
}
else
{
VerifyOrExit(aFrameLength >= sizeof(Ip6::UdpHeader), error = OT_ERROR_PARSE);
memcpy(&udpHeader, aFrame, sizeof(Ip6::UdpHeader));
}