File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -774,12 +774,15 @@ string APLRecordContent::getZoneRepresentation(bool /* noDot */) const {
774774 if (ard->d_family == APL_FAMILY_IPV4) { // IPv4
775775 s_family = std::to_string (APL_FAMILY_IPV4);
776776 ca = ComboAddress ();
777- memcpy (&ca.sin4 .sin_addr .s_addr , ard->d_ip .d_ip4 , sizeof (ca.sin4 .sin_addr .s_addr ));
777+ memset (&ca.sin4 .sin_addr .s_addr , 0 , sizeof (ca.sin4 .sin_addr .s_addr ));
778+ // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
779+ memcpy (&ca.sin4 .sin_addr .s_addr , ard->d_ip .d_ip4 , ard->d_afdlength );
778780 } else if (ard->d_family == APL_FAMILY_IPV6) { // IPv6
779781 s_family = std::to_string (APL_FAMILY_IPV6);
780782 ca = ComboAddress ();
781783 ca.sin4 .sin_family = AF_INET6;
782784 memset (&ca.sin6 .sin6_addr .s6_addr , 0 , sizeof (ca.sin6 .sin6_addr .s6_addr ));
785+ // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-array-to-pointer-decay)
783786 memcpy (&ca.sin6 .sin6_addr .s6_addr , ard->d_ip .d_ip6 , ard->d_afdlength );
784787 } else {
785788 throw MOADNSException (" Asked to decode APL record but got unknown Address Family" );
You can’t perform that action at this time.
0 commit comments