diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 45986f3f527..2f87d4fd9d6 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -54,6 +54,7 @@ Thank you! Andrew Novikov Andrew Tridgell Andrey + Andrey Kolesnik Andrey Shorin Ankor Anonymous diff --git a/src/wccp2.cc b/src/wccp2.cc index 4a95e7d0eaf..b8ef701bb31 100644 --- a/src/wccp2.cc +++ b/src/wccp2.cc @@ -1142,9 +1142,9 @@ static size_t CheckFieldDataLength(const FieldHeader *header, const size_t dataLength, const void *areaStart, const size_t areaSize, const char *error) { assert(header); - const auto dataStart = reinterpret_cast(header) + sizeof(header); + const auto dataStart = reinterpret_cast(header) + sizeof(*header); CheckSectionLength(dataStart, dataLength, areaStart, areaSize, error); - return sizeof(header) + dataLength; // no overflow after CheckSectionLength() + return sizeof(*header) + dataLength; // no overflow after CheckSectionLength() } /// Positions the given field at a given start within a given packet area.