From 5941ee6799b75d8996a6467a4ca0ea03ef06ed99 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 5 Feb 2021 12:25:07 +0100 Subject: [PATCH] lf t55xx p1detect - too small alloc for argtable --- client/src/cmdlft55xx.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/client/src/cmdlft55xx.c b/client/src/cmdlft55xx.c index d11ed8e0d..3614a0e2f 100644 --- a/client/src/cmdlft55xx.c +++ b/client/src/cmdlft55xx.c @@ -98,7 +98,7 @@ static void arg_add_t55xx_downloadlink(void *at[], uint8_t *idx, uint8_t show, u at[n++] = arg_lit0(NULL, "r3", r3); if (show == T55XX_DLMODE_ALL) { - char *r4 = (char *)calloc(50, sizeof(uint8_t)); + char *r4 = (char *)calloc(56, sizeof(uint8_t)); sprintf(r4, "try all downlink modes %s", (dl_mode_def == 4) ? "(def)" : ""); at[n++] = arg_lit0(NULL, "all", r4); } @@ -106,7 +106,6 @@ static void arg_add_t55xx_downloadlink(void *at[], uint8_t *idx, uint8_t show, u *idx = n; } - static int usage_t55xx_config(void) { PrintAndLogEx(NORMAL, "Usage: lf t55xx config [c ] [d ] [i [0/1]] [o ] [Q5 [0/1]] [ST [0/1]]"); PrintAndLogEx(NORMAL, "Options:"); @@ -3565,8 +3564,8 @@ static int CmdT55xxDetectPage1(const char *Cmd) { "lf t55xx p1detect -p 11223344 --r3\n" ); - // 2 + (5 or 6) - void *argtable[7] = { + // 1 (help) + 2 (two user specified params) + ( 5 T55XX_DLMODE_SINGLE) + void *argtable[8] = { arg_param_begin, arg_lit0("1", NULL, "extract using data from graphbuffer"), arg_str0("p", "pwd", "", "password (4 hex bytes)"),