From e8e6f0e371669e800f379a3f3e9aa194f301dbbb Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Fri, 21 Feb 2025 11:49:51 +0300 Subject: [PATCH] Added a fix to only hash valid PINs in SaveOthersTemporaryPin --- handlers/application/menuhandler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/handlers/application/menuhandler.go b/handlers/application/menuhandler.go index 0337c9b..b4cbd7b 100644 --- a/handlers/application/menuhandler.go +++ b/handlers/application/menuhandler.go @@ -384,6 +384,12 @@ func (h *MenuHandlers) SaveOthersTemporaryPin(ctx context.Context, sym string, i } temporaryPin := string(input) + + // Validate that the input is a 4-digit number. + if !pin.IsValidPIN(temporaryPin) { + return res, nil + } + // Retrieve the blocked number associated with this session blockedNumber, err := store.ReadEntry(ctx, sessionId, storedb.DATA_BLOCKED_NUMBER) if err != nil {