From a3161ae9a2ca58e7debcf08f0b8cada09429f147 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 19 Sep 2019 13:12:48 +0200 Subject: [PATCH] fix 'lf em 4x50_read - now checks if have enough data in Graphbuffer --- client/cmdlfem4x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/cmdlfem4x.c b/client/cmdlfem4x.c index b7948b14c..e7b1c2b06 100644 --- a/client/cmdlfem4x.c +++ b/client/cmdlfem4x.c @@ -821,6 +821,12 @@ int EM4x50Read(const char *Cmd, bool verbose) { uint8_t bits[MAX_GRAPH_TRACE_LEN] = {0}; size_t size = getFromGraphBuf(bits); + + if (size < 4000) { + if (verbose || g_debugMode) PrintAndLogEx(ERR, "Error: EM4x50 - Too little data in Graphbuffer"); + return PM3_ESOFT; + } + computeSignalProperties(bits, size); signal_t *sp = getSignalProperties();