Skip to content

Commit

Permalink
fix UB when reading key file
Browse files Browse the repository at this point in the history
  • Loading branch information
lionkor committed Mar 9, 2024
1 parent ebdb94f commit 15691ad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Identity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Result<ident::Identity, std::string> ident::login_cached() noexcept {
std::ifstream key_file(ident::KEYFILE);
if (key_file.is_open()) {
auto size = fs::file_size(ident::KEYFILE);
private_key.resize(size);
key_file.read(&private_key[0], static_cast<long>(size));
key_file.close();
}
Expand Down

0 comments on commit 15691ad

Please sign in to comment.