From: henryk@ploetzli.ch Date: Thu, 4 Feb 2010 02:49:21 +0000 (+0000) Subject: Limit DbpString size to the buffer size, patch by Andreas from proxmark forums X-Git-Tag: v1.0.0~391 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/92e592ce71c995c68b0ed455c58b2d0dacd406bc Limit DbpString size to the buffer size, patch by Andreas from proxmark forums --- 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));