From 665a37892586d4c99bbf91feace2926e39c1b60f Mon Sep 17 00:00:00 2001 From: "Aaron Tulino (Aaronjamt)" Date: Sat, 13 Jun 2026 17:37:07 -0700 Subject: [PATCH] Fix `WRITEBLOCK` read out-of-bounds --- client/src/cmdhflist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/cmdhflist.c b/client/src/cmdhflist.c index d02c2e16b..bca2014b3 100644 --- a/client/src/cmdhflist.c +++ b/client/src/cmdhflist.c @@ -424,7 +424,7 @@ int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool i case MIFARE_ULC_WRITE : { if (cmd[1] < 0x21) snprintf(exp, size, "WRITEBLOCK(" _MAGENTA_("%d") ")", cmd[1]); - else + else if (cmdsize >= 6) // outside limits, useful for some tags... snprintf(exp, size, "WRITEBLOCK(" _MAGENTA_("%d") ") (%s)", cmd[1], sprint_hex_inrow(cmd + 2, 4)); break;