The branch, eeprom-new has been updated
via b95e46548cdf96ef21b3de2a1b3d55ceeca12075 (commit)
from d327f924c20f61561facfd9537fc495beb3fc315 (commit)
- Log -----------------------------------------------------------------
commit b95e46548cdf96ef21b3de2a1b3d55ceeca12075
Author: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
Date: Sat Jan 15 18:32:47 2011 +0100
Introduce size limit in ftdi_get_eeprom_buf()
-----------------------------------------------------------------------
Summary of changes:
src/ftdi.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/ftdi.c b/src/ftdi.c
index c9e8892..4cc55e4 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -3257,7 +3257,13 @@ int ftdi_get_eeprom_buf(struct ftdi_context *ftdi,
unsigned char * buf, int size
{
if (!ftdi || !(ftdi->eeprom))
ftdi_error_return(-1, "No appropriate structure");
+
+ // Only copy up to FTDI_MAX_EEPROM_SIZE bytes
+ if (size > FTDI_MAX_EEPROM_SIZE)
+ size = FTDI_MAX_EEPROM_SIZE;
+
memcpy(buf, ftdi->eeprom->buf, size);
+
return 0;
}
hooks/post-receive
--
port libftdi to libusb-1.0
--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
|