libftdi Archives

Subject: Add missing check for NULL product string

From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 20 Jun 2011 15:16:05 +0200
-- 
Uwe Bonnes                bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
>From 9dbfcecf35da4a71951480ef3b646b9c62bb73b6 Mon Sep 17 00:00:00 2001
From: Uwe Bonnes <bon@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 20 Jun 2011 15:13:14 +0200
Subject: Add missing check for NULL product string

---
 src/ftdi.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/ftdi.c b/src/ftdi.c
index 957bed2..3301844 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -2228,6 +2228,7 @@ int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, 
char * manufacturer,
     if (eeprom->product)
         free (eeprom->product);
     eeprom->product = NULL;
+    if(product)
     {
         eeprom->product = malloc(strlen(product)+1);
         if (eeprom->product)
-- 
1.7.3.4


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

Current Thread
  • Add missing check for NULL product string, Uwe Bonnes <=