From 12b3a7c2363df17e4c735d121c896ab4a33d3538 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 4 Oct 2020 02:24:10 +0200 Subject: [PATCH] fix: data mtrim - no crashing --- client/src/cmddata.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/cmddata.c b/client/src/cmddata.c index ffa6785b4..74f6b4a23 100644 --- a/client/src/cmddata.c +++ b/client/src/cmddata.c @@ -1825,7 +1825,8 @@ static int CmdMtrim(const char *Cmd) { uint32_t start = 0, stop = 0; sscanf(Cmd, "%u %u", &start, &stop); - if (start > GraphTraceLen || stop > GraphTraceLen || start > stop) return PM3_ESOFT; + if (start > GraphTraceLen || stop > GraphTraceLen || start >= stop) + return PM3_ESOFT; // leave start position sample start++;