diff --git a/src/libcalamares/utils/Entropy.cpp b/src/libcalamares/utils/Entropy.cpp index d28230a85..67a0718f5 100644 --- a/src/libcalamares/utils/Entropy.cpp +++ b/src/libcalamares/utils/Entropy.cpp @@ -18,15 +18,17 @@ CalamaresUtils::EntropySource CalamaresUtils::getEntropy( int size, QByteArray& b ) { + constexpr const char filler = char( 0xcb ); + + b.fill( filler ); b.clear(); if ( size < 1 ) { return EntropySource::None; } - b.resize( size ); + b.fill( filler, size ); char* buffer = b.data(); - std::fill( buffer, buffer + size, 0xcb ); qint64 readSize = 0; QFile urandom( "/dev/urandom" );