git://developer.intra2net.com
/
libftdi
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
45a3ebd
)
Prevent possible segfault
author
Nathael Pajani
<nathael.pajani@ed3l.fr>
Wed, 10 Apr 2013 08:10:13 +0000 (10:10 +0200)
committer
Thomas Jarosch
<thomas.jarosch@intra2net.com>
Wed, 10 Apr 2013 08:10:13 +0000 (10:10 +0200)
src/ftdi.c
patch
|
blob
|
blame
|
history
diff --git
a/src/ftdi.c
b/src/ftdi.c
index
64257da
..
ccbb487
100644
(file)
--- 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);