Skip to content

Commit

Permalink
Merge pull request #1667 from esindril/fix_xrdscitokens
Browse files Browse the repository at this point in the history
[XrdSciTokens] Fix memory corruption
  • Loading branch information
abh3 committed Apr 5, 2022
2 parents 8bbf053 + 38380af commit 00f58ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/XrdSciTokens/XrdSciTokensAccess.cc
Expand Up @@ -387,7 +387,7 @@ class XrdAccSciTokens : public XrdAccAuthorize, public XrdSciTokensHelper
ss << grp << " ";
}
const auto &groups_str = ss.str();
new_secentity.grps = static_cast<char*>(malloc(groups_str.size()));
new_secentity.grps = static_cast<char*>(malloc(groups_str.size() + 1));
if (new_secentity.grps) {
memcpy(new_secentity.grps, groups_str.c_str(), groups_str.size());
new_secentity.grps[groups_str.size()] = '\0';
Expand Down

0 comments on commit 00f58ea

Please sign in to comment.