EEPROM: Null out buffer after allocation
authorUwe Bonnes <bon@elektron.ikp.physik.tu-darmstadt.de>
Wed, 15 Sep 2010 15:32:48 +0000 (17:32 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Mon, 20 Sep 2010 13:34:45 +0000 (15:34 +0200)
src/ftdi.c

index 16af24e..c9492f5 100644 (file)
@@ -105,6 +105,7 @@ int ftdi_init(struct ftdi_context *ftdi)
 
     if (eeprom == 0)
         ftdi_error_return(-2, "Can't malloc struct ftdi_eeprom");
+    memset(eeprom, 0, sizeof(struct ftdi_eeprom);
     ftdi->eeprom = eeprom;
 
     /* All fine. Now allocate the readbuffer */