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 11, 2023
1 parent 128ebda commit a97f63b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/multistat.cpp
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 a97f63b

Please sign in to comment.