From e2671d5b50c5b19a82a43055119f3475ee898757 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 13 May 2020 12:26:37 +0200 Subject: [PATCH] fix coverity 286654 wrong sized argument --- client/src/cmdhfmfdes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 7dad78f88..f86363638 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -2469,12 +2469,12 @@ static int CmdHF14ADesWriteData(const char *Cmd) { CLIGetHexWithReturn(3, offset, &offsetlength); int dlength = 0xFFFF; - uint8_t *data = (uint8_t *)calloc(0xFFFF, sizeof(uint8_t)); + uint8_t *data = (uint8_t *)calloc(dlength, sizeof(uint8_t)); if (data == NULL) { PrintAndLogEx(ERR, "failed to allocate memory"); return PM3_EMALLOC; } - if (CLIParamHexToBuf(arg_get_str(4), data, sizeof(data), &dlength)) { + if (CLIParamHexToBuf(arg_get_str(4), data, dlength, &dlength)) { free(data); CLIParserFree(); return PM3_ESOFT;