diff --git a/CHANGES b/CHANGES index c6db0f64b4..79d33a5b1f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,9 @@ +3.3.0-dev.117 | 2020-08-19 14:12:06 -0700 + + * Use constexpr for IPAddr::v4_mapped_prefix declaration + + The inconsistent use of constexpr in the definition but not declaration + causes an unrecoverable error for Coverity as seen in issue 1431151 (Jon Siwek, Corelight) 3.3.0-dev.115 | 2020-08-19 11:49:24 -0700 diff --git a/VERSION b/VERSION index 23541fc477..fe20f66131 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.3.0-dev.115 +3.3.0-dev.117 diff --git a/src/IPAddr.cc b/src/IPAddr.cc index 4bc73a7ab2..a7ce08354d 100644 --- a/src/IPAddr.cc +++ b/src/IPAddr.cc @@ -12,10 +12,6 @@ #include "analyzer/Manager.h" -constexpr uint8_t zeek::IPAddr::v4_mapped_prefix[12] = { 0, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0xff, 0xff }; - const zeek::IPAddr zeek::IPAddr::v4_unspecified = zeek::IPAddr(in4_addr{}); const zeek::IPAddr zeek::IPAddr::v6_unspecified = zeek::IPAddr(); diff --git a/src/IPAddr.h b/src/IPAddr.h index 4df0b6aae4..107995a29f 100644 --- a/src/IPAddr.h +++ b/src/IPAddr.h @@ -459,7 +459,10 @@ private: in6_addr in6; // IPv6 or v4-to-v6-mapped address - static const uint8_t v4_mapped_prefix[12]; // top 96 bits of v4-mapped-addr + // Top 96 bits of a v4-mapped-addr. + static constexpr uint8_t v4_mapped_prefix[12] = { 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0xff, 0xff }; }; inline IPAddr::IPAddr(Family family, const uint32_t* bytes, ByteOrder order)