From 92e592ce71c995c68b0ed455c58b2d0dacd406bc Mon Sep 17 00:00:00 2001 From: "henryk@ploetzli.ch" Date: Thu, 4 Feb 2010 02:49:21 +0000 Subject: [PATCH] Limit DbpString size to the buffer size, patch by Andreas from proxmark forums --- armsrc/appmain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 4321d946..ecf22adf 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -76,6 +76,9 @@ void DbpString(char *str) UsbCommand c; c.cmd = CMD_DEBUG_PRINT_STRING; c.arg[0] = strlen(str); + if(c.arg[0] > sizeof(c.d.asBytes)) { + c.arg[0] = sizeof(c.d.asBytes); + } memcpy(c.d.asBytes, str, c.arg[0]); UsbSendPacket((BYTE *)&c, sizeof(c)); -- 2.39.2