]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Limit DbpString size to the buffer size, patch by Andreas from proxmark forums
authorhenryk@ploetzli.ch <henryk@ploetzli.ch@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 4 Feb 2010 02:49:21 +0000 (02:49 +0000)
committerhenryk@ploetzli.ch <henryk@ploetzli.ch@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 4 Feb 2010 02:49:21 +0000 (02:49 +0000)
armsrc/appmain.c

index 4321d9469afabb0f0bf52e755aeee8b7e8083ad3..ecf22adfed41b5e0990dc78452a123966675cfa1 100644 (file)
@@ -76,6 +76,9 @@ void DbpString(char *str)
        UsbCommand c;\r
        c.cmd = CMD_DEBUG_PRINT_STRING;\r
        c.arg[0] = strlen(str);\r
+       if(c.arg[0] > sizeof(c.d.asBytes)) {\r
+               c.arg[0] = sizeof(c.d.asBytes);\r
+       }\r
        memcpy(c.d.asBytes, str, c.arg[0]);\r
 \r
        UsbSendPacket((BYTE *)&c, sizeof(c));\r
Impressum, Datenschutz