From 6a085d7f8ea2e4092c3dae2042893489a504ff7c Mon Sep 17 00:00:00 2001 From: BranchManager Date: Sun, 3 Mar 2024 19:26:38 -0500 Subject: [PATCH] core: don't auth on empty password (#126) --- src/core/hyprlock.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/hyprlock.cpp b/src/core/hyprlock.cpp index 42a3277..b3fbc36 100644 --- a/src/core/hyprlock.cpp +++ b/src/core/hyprlock.cpp @@ -703,9 +703,11 @@ void CHyprlock::onKey(uint32_t key, bool down) { if (m_sPasswordState.passBuffer.length() > 0) m_sPasswordState.passBuffer = m_sPasswordState.passBuffer.substr(0, m_sPasswordState.passBuffer.length() - 1); } else if (SYM == XKB_KEY_Return || SYM == XKB_KEY_KP_Enter) { - Debug::log(LOG, "Authenticating"); + if (m_sPasswordState.passBuffer.length() > 0) { + Debug::log(LOG, "Authenticating"); - m_sPasswordState.result = g_pPassword->verify(m_sPasswordState.passBuffer); + m_sPasswordState.result = g_pPassword->verify(m_sPasswordState.passBuffer); + } } else if (SYM == XKB_KEY_Escape) { Debug::log(LOG, "Clearing password buffer");