Skip to content

Commit

Permalink
saveMultiStats: Refuse to persist if identity is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Oct 10, 2023
1 parent 626ccd4 commit 7443486
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/multistat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,12 @@ bool saveMultiStats(const char *sFileName, const char *sPlayerName, const PLAYER
}
char buffer[1000];

if (st->identity.empty())
{
debug(LOG_INFO, "Refusing to save profile with empty identity: %s", sFileName);
return false;
}

ssprintf(buffer, "WZ.STA.v3\n%u %u %u %u %u\n%s\n",
st->wins, st->losses, st->totalKills, st->totalScore, st->played, base64Encode(st->identity.toBytes(EcKey::Private)).c_str());

Expand Down

0 comments on commit 7443486

Please sign in to comment.