Limit DbpString size to the buffer size, patch by Andreas from proxmark forums

This commit is contained in:
henryk@ploetzli.ch 2010-02-04 02:49:21 +00:00
parent 7fe9b0b742
commit 92e592ce71

View file

@ -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));