Skip to content

Commit

Permalink
auth: catalog, include groups in hash calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
mind04 authored and Habbie committed Mar 7, 2024
1 parent a74877c commit b099d81
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pdns/auth-catalogzone.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ std::string CatalogInfo::toJson() const
}
if (!d_group.empty()) {
json11::Json::array entries;
for (const string& group : d_group) {
for (const auto& group : d_group) {
entries.push_back(group);
}
object["group"] = entries;
Expand All @@ -107,7 +107,10 @@ std::string CatalogInfo::toJson() const

void CatalogInfo::updateHash(CatalogHashMap& hashes, const DomainInfo& di) const
{
hashes[di.catalog].process(static_cast<char>(di.id) + di.zone.toLogString() + "\0" + d_coo.toLogString() + "\0" + d_unique.toLogString());
hashes[di.catalog].process(std::to_string(di.id) + di.zone.toLogString() + "\0" + d_coo.toLogString() + "\0" + d_unique.toLogString());

Check warning on line 110 in pdns/auth-catalogzone.cc

View workflow job for this annotation

GitHub Actions / Analyze (cpp, auth)

truncated string literal with embedded NUL character (bugprone-string-literal-with-embedded-nul - Level=Warning)

Check warning on line 110 in pdns/auth-catalogzone.cc

View workflow job for this annotation

GitHub Actions / Analyze (cpp, auth)

truncated string literal with embedded NUL character (bugprone-string-literal-with-embedded-nul - Level=Warning)
for (const auto& group : d_group) {
hashes[di.catalog].process(std::to_string(group.length()) + group);
}
}

DNSZoneRecord CatalogInfo::getCatalogVersionRecord(const DNSName& zone)
Expand Down

0 comments on commit b099d81

Please sign in to comment.