From 1ab498001e814d5d1680f1499be30dda24eeeda8 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sat, 3 Feb 2018 23:05:01 +0100 Subject: [PATCH] fix: 'reveng -g' stack crash by too small array --- client/cmdcrc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/cmdcrc.c b/client/cmdcrc.c index 1d2aba788..45d9bb232 100644 --- a/client/cmdcrc.c +++ b/client/cmdcrc.c @@ -400,9 +400,11 @@ int CmdrevengSearch(const char *Cmd){ int dataLen = param_getstr(Cmd, 0, inHexStr, sizeof(inHexStr)); if (dataLen < 4) return 0; + // these two arrays, must match preset size. char *Models[102]; + uint8_t width[102] = {0}; int count = 0; - uint8_t width[80] = {0}; + uint8_t crcChars = 0; char result[30]; char revResult[30]; @@ -477,4 +479,4 @@ int CmdrevengSearch(const char *Cmd){ if (!found) PrintAndLog("\nNo matches found\n"); return 1; -} +} \ No newline at end of file