Skip to content

Commit

Permalink
Limit user property count sooner
Browse files Browse the repository at this point in the history
  • Loading branch information
halfgaar committed Nov 16, 2024
1 parent 8c074fa commit 6a13b3c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,9 @@ void Publish::addUserProperty(std::string &&key, std::string &&val)
if (!userProperties)
userProperties = std::make_shared<std::vector<std::pair<std::string, std::string>>>();

if (userProperties->size() > 50)
throw ProtocolError("Trying to set more than 50 user properties. Likely a bad actor.", ReasonCodes::ImplementationSpecificError);

userProperties->emplace_back(std::move(key), std::move(val));
}

Expand Down

0 comments on commit 6a13b3c

Please sign in to comment.