[network-data] add length validation to Service TLV (#2542)

Credit to OSS-Fuzz.
This commit is contained in:
Jonathan Hui
2018-02-06 17:23:53 +00:00
committed by GitHub
parent cc8579fb3f
commit 56bf6a79f7
@@ -862,6 +862,7 @@ otError Leader::AddService(ServiceTlv &aService, uint8_t *aOldTlvs, uint8_t aOld
NetworkDataTlv *cur;
NetworkDataTlv *end;
VerifyOrExit(aService.IsValid(), error = OT_ERROR_PARSE);
cur = aService.GetSubTlvs();
end = aService.GetNext();