From: bushing Date: Wed, 27 Jan 2010 09:25:37 +0000 (+0000) Subject: fix a stack overflow in the flasher routine (my bad) X-Git-Tag: v1.0.0~395 X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/cef938d8830cd97783cb50fe68569e59ee9a1373?hp=70b1a685433e39f7d9715d5321a4464eecf68733 fix a stack overflow in the flasher routine (my bad) --- diff --git a/client/flash.c b/client/flash.c index b01bb154..61d5cf75 100644 --- a/client/flash.c +++ b/client/flash.c @@ -52,9 +52,11 @@ void WriteBlock(unsigned int block_start, unsigned int len, unsigned char *buf) if (block_start & 0xFF) { printf("moving stuff forward by %d bytes\n", block_start & 0xFF); memset(temp_buf, 0xFF, block_start & 0xFF); - memcpy(temp_buf + (block_start & 0xFF), buf, len); + memcpy(temp_buf + (block_start & 0xFF), buf, len - (block_start & 0xFF)); block_start &= ~0xFF; - } else memcpy(temp_buf, buf, len); + } else { + memcpy(temp_buf, buf, len); + } UsbCommand c = {CMD_SETUP_WRITE};