lic: Fixed crash in License destruction (issue #698)
This commit is contained in:
@@ -43,7 +43,6 @@ std::string removeCaption(const std::string& line, const std::string& caption)
|
||||
}
|
||||
|
||||
License::License()
|
||||
: m_rng(std::make_unique<Botan::AutoSeeded_RNG>())
|
||||
{
|
||||
}
|
||||
|
||||
@@ -335,12 +334,14 @@ std::string License::getLicenseString() const
|
||||
|
||||
std::string License::generateHash(const std::string& str) const
|
||||
{
|
||||
if (m_rng == NULL || str.size() <= 0)
|
||||
if (str.size() <= 0)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
return Botan::generate_passhash9(str, *(m_rng.get()));
|
||||
Botan::AutoSeeded_RNG rng;
|
||||
|
||||
return Botan::generate_passhash9(str, rng);
|
||||
}
|
||||
|
||||
bool License::checkHash(const std::string& str, const std::string& hash)
|
||||
|
||||
@@ -5,11 +5,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace Botan
|
||||
{
|
||||
class AutoSeeded_RNG;
|
||||
}
|
||||
|
||||
namespace LicenseConstants
|
||||
{
|
||||
const char BEGIN_LICENSE[] = "-----BEGIN LICENSE-----";
|
||||
@@ -85,8 +80,6 @@ private:
|
||||
bool loadFromLines(const std::vector<std::string>& lines);
|
||||
bool loadFromLinesOld(const std::vector<std::string>& lines);
|
||||
|
||||
std::unique_ptr<Botan::AutoSeeded_RNG> m_rng;
|
||||
|
||||
std::string m_user;
|
||||
std::string m_type;
|
||||
size_t m_numberOfUsers = 0;
|
||||
|
||||
Reference in New Issue
Block a user