diff --git a/src/core/Entry.cpp b/src/core/Entry.cpp index 65a271c2..0322d353 100644 --- a/src/core/Entry.cpp +++ b/src/core/Entry.cpp @@ -481,6 +481,8 @@ void Entry::updateTotp() m_attributes->value(Totp::ATTRIBUTE_SEED)); } else if (m_attributes->contains(Totp::ATTRIBUTE_OTP)) { m_data.totpSettings = Totp::parseSettings(m_attributes->value(Totp::ATTRIBUTE_OTP)); + } else { + m_data.totpSettings.reset(); } } diff --git a/src/totp/totp.cpp b/src/totp/totp.cpp index 105196fc..1936cce7 100644 --- a/src/totp/totp.cpp +++ b/src/totp/totp.cpp @@ -113,7 +113,7 @@ QSharedPointer Totp::parseSettings(const QString& rawSettings, c } // Bound digits and step - settings->digits = qMax(1u, settings->digits); + settings->digits = qBound(1u, settings->digits, 10u); settings->step = qBound(1u, settings->step, 60u); // Detect custom settings, used by setup GUI