generator: resize dst string to needed size
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-08 07:12:42 +01:00
parent 3d22b8de8b
commit b3c1033e6a
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -163,6 +163,8 @@ auto Generator::generate_random_data(uint n) -> std::string {
std::string nu_G_k{generate_blocks(2)};
// fmt::print("nu_G_k: {}\n", nu_G_k); // debugging
std::string dst;
// FIXME: +1 for the actual null-termination, not exactly sure if needed
dst.resize(G.k_length + 1);
CryptoPP::StringSource str_s(
nu_G_k,true,new CryptoPP::HexDecoder(new CryptoPP::StringSink(dst))
);