Commit 53be6a40 authored by Daniel McArdle's avatar Daniel McArdle Committed by Commit Bot

Add bounds check to AddressTrackerLinux for struct ifa_cacheinfo

Bug: 1022111
Change-Id: Ie53859f448dff5fe60486738990e6bfd60cf5550
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1937783Reviewed-by: default avatarPaul Jensen <pauljensen@chromium.org>
Commit-Queue: Dan McArdle <dmcardle@chromium.org>
Cr-Commit-Position: refs/heads/master@{#719633}
parent 1c868205
......@@ -94,7 +94,12 @@ bool GetAddress(const struct nlmsghdr* header,
local = reinterpret_cast<uint8_t*>(RTA_DATA(attr));
break;
case IFA_CACHEINFO: {
const struct ifa_cacheinfo *cache_info =
if (RTA_PAYLOAD(attr) < sizeof(struct ifa_cacheinfo)) {
LOG(ERROR)
<< "attr does not have enough bytes to read an ifa_cacheinfo";
return false;
}
const struct ifa_cacheinfo* cache_info =
reinterpret_cast<const struct ifa_cacheinfo*>(RTA_DATA(attr));
if (really_deprecated)
*really_deprecated = (cache_info->ifa_prefered == 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment