From 8e04df77ba453344eb97ac9b8b0d7a126fe3d4a5 Mon Sep 17 00:00:00 2001 From: Brian Pow Date: Wed, 7 Feb 2018 22:00:25 +0800 Subject: [PATCH] FIX: GenerateFilename() return broken filename if no tag is detected. --- client/cmdhfmf.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index fcf1820a0..a18d50ea8 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -364,7 +364,8 @@ char * GenerateFilename(const char *prefix, const char *suffix){ int uidlen=0; char * fptr = malloc (sizeof (char) * (strlen(prefix) + strlen(suffix)) + sizeof(uid)*2 + 1); - if (!GetHFMF14AUID(uid, &uidlen)) { + GetHFMF14AUID(uid, &uidlen); + if (!uidlen) { PrintAndLog("No tag found."); return NULL; }