From fb35a29ba079fb6f38dc02945c0cd99e68e01a1c Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 24 Jul 2023 15:18:56 +0200 Subject: [PATCH] coverity doesnt think we checked the bytes_read values enough. lets add a check --- client/src/cmdnfc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/cmdnfc.c b/client/src/cmdnfc.c index eadfa7161..431464076 100644 --- a/client/src/cmdnfc.c +++ b/client/src/cmdnfc.c @@ -109,7 +109,7 @@ static int CmdNfcDecode(const char *Cmd) { uint8_t *dump = NULL; size_t bytes_read = 4096; res = pm3_load_dump(filename, (void **)&dump, &bytes_read, 4096); - if (res != PM3_SUCCESS || dump == NULL) { + if (res != PM3_SUCCESS || dump == NULL || bytes_read > 4096) { return res; }