See attached file.

-- 
Nathaël PAJANI
ED3L - Étude et Développement - Linux et Logiciels Libres
Internet : http://www.ed3l.fr


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to [email protected]   
commit f67a1d1b2732cc96dbe4e5bc356a210b2af66e7f
Author: Nathael Pajani <[email protected]>
Date:   Fri Mar 29 16:41:35 2013 +0100

    Prevent possible segfault

diff --git a/src/ftdi.c b/src/ftdi.c
index 2696c21..00c16dd 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -3030,7 +3030,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int 
verbose)
     unsigned char manufacturer_size = 0, product_size = 0, serial_size = 0;
     int eeprom_size;
     struct ftdi_eeprom *eeprom;
-    unsigned char *buf = ftdi->eeprom->buf;
+    unsigned char *buf = NULL;
 
     if (ftdi == NULL)
         ftdi_error_return(-1,"No context");
@@ -3039,6 +3039,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int 
verbose)
 
     eeprom = ftdi->eeprom;
     eeprom_size = eeprom->size;
+    buf = ftdi->eeprom->buf;
 
     // Addr 02: Vendor ID
     eeprom->vendor_id = buf[0x02] + (buf[0x03] << 8);

Reply via email to