From: Remi Gacogne Date: Tue, 4 Jun 2019 07:28:50 +0000 (+0200) Subject: Use sizeof when initializing NSECBitmapGenerator::res X-Git-Tag: dnsdist-1.4.0-beta1~8^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=acefbd3cd7ec219071849f7b10239f463140a6da;p=pdns Use sizeof when initializing NSECBitmapGenerator::res --- diff --git a/pdns/nsecrecords.cc b/pdns/nsecrecords.cc index ce04ddde0..21e6d13da 100644 --- a/pdns/nsecrecords.cc +++ b/pdns/nsecrecords.cc @@ -29,7 +29,7 @@ class NSECBitmapGenerator public: NSECBitmapGenerator(DNSPacketWriter& pw_): pw(pw_) { - memset(res, 0, 34); + memset(res, 0, sizeof(res)); } void set(uint16_t type) @@ -44,7 +44,7 @@ public: tmp.assign(res, res+len+2); pw.xfrBlob(tmp); } - memset(res, 0, 34); + memset(res, 0, sizeof(res)); oldWindow = window; } res[2+bit/8] |= 1 << (7-(bit%8));