From 1c5ed0b1a10275a53653a7d9ece6ea711416d630 Mon Sep 17 00:00:00 2001 From: Roland Bewick Date: Wed, 5 Mar 2025 22:55:19 +0700 Subject: [PATCH] fix: do not allow changing unlock password to an empty password --- config/config.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config/config.go b/config/config.go index 5fb7c5ad..a6c1b3a3 100644 --- a/config/config.go +++ b/config/config.go @@ -212,6 +212,9 @@ func (cfg *config) SetUpdate(key string, value string, encryptionKey string) err } func (cfg *config) ChangeUnlockPassword(currentUnlockPassword string, newUnlockPassword string) error { + if newUnlockPassword == "" { + return errors.New("New unlock password must not be empty") + } if !cfg.CheckUnlockPassword(currentUnlockPassword) { return errors.New("incorrect password") }