From 78b621264cc6b18bb721b2a583aff3e41e6dbd16 Mon Sep 17 00:00:00 2001 From: towelbyte Date: Fri, 26 Jun 2026 20:23:13 +0200 Subject: [PATCH] Fix (limit) 'lf cotag demod' custom clock argument --- client/src/cmdlfcotag.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client/src/cmdlfcotag.c b/client/src/cmdlfcotag.c index 9a1d154e9..2ffab3c54 100644 --- a/client/src/cmdlfcotag.c +++ b/client/src/cmdlfcotag.c @@ -428,6 +428,10 @@ end: int demodCOTAG(bool verbose, int clock, int threshold) { int clk = (clock > 0) ? clock : LF_COTAG_CLOCK; + if (clk < 32) { + PrintAndLogEx(FAILED, "custom clock must be >= 32, got " _RED_("%d"), clk); + return PM3_EINVARG; + } return demod_cotag(g_GraphBuffer, (int)g_GraphTraceLen, clk, -1, threshold, verbose); }