From 06b82e6a6d84d81ba84140dcd1417fcd27b71554 Mon Sep 17 00:00:00 2001 From: "izsh@fail0verflow.com" Date: Sun, 20 Oct 2013 11:46:51 +0000 Subject: [PATCH] cmdhf14b.c: fixing a crash in the crc computation when missing data (e.g. with 'hf 14b raw -c -p') --- client/cmdhf14b.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/client/cmdhf14b.c b/client/cmdhf14b.c index 5317994f..6696ac09 100644 --- a/client/cmdhf14b.c +++ b/client/cmdhf14b.c @@ -334,6 +334,11 @@ int CmdHF14BCmdRaw (const char *cmd) { PrintAndLog("Invalid char on input"); return 0; } + if (datalen == 0) + { + PrintAndLog("Missing data input"); + return 0; + } if(crc) { uint8_t first, second; -- 2.39.5