libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v1.0-12-g3bc0387

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Wed, 10 Apr 2013 10:10:40 +0200 (CEST)
The branch, master has been updated
       via  3bc0387ed13b23a14c1012d37c2a926218c9f9f7 (commit)
      from  45a3ebd502c405488935ac61e502296942b9b83a (commit)


- Log -----------------------------------------------------------------
commit 3bc0387ed13b23a14c1012d37c2a926218c9f9f7
Author: Nathael Pajani <nathael.pajani@xxxxxxx>
Date:   Wed Apr 10 10:10:13 2013 +0200

    Prevent possible segfault

-----------------------------------------------------------------------

Summary of changes:
 src/ftdi.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index 64257da..ccbb487 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -3025,7 +3025,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");
@@ -3034,6 +3034,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);


hooks/post-receive
-- 
A library to talk to FTDI chips

--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx   

Current Thread
  • A library to talk to FTDI chips branch, master, updated. v1.0-12-g3bc0387, libftdi-git <=