fix: data mtrim - no crashing

This commit is contained in:
iceman1001 2020-10-04 02:24:10 +02:00
parent dd970ea562
commit 12b3a7c236

View file

@ -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++;