libftdi-git Archives

Subject: A library to talk to FTDI chips branch, master, updated. v0.18-10-g236e16d

From: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
To: libftdi-git@xxxxxxxxxxxxxxxxxxxxxxx
Date: Mon, 25 Oct 2010 12:34:57 +0200 (CEST)
The branch, master has been updated
       via  236e16d12a347db827c913a743fa6aab3d35d22e (commit)
      from  2ff8b87c6e8ec258b705240b03cc2100b50c16bf (commit)


- Log -----------------------------------------------------------------
commit 236e16d12a347db827c913a743fa6aab3d35d22e
Author: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
Date:   Mon Oct 25 12:34:55 2010 +0200

    Fix uninitialized memory access of ret variable in async mode

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

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

diff --git a/src/ftdi.c b/src/ftdi.c
index e2d7980..06f6293 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -1331,7 +1331,7 @@ static int _usb_get_async_urbs_pending(struct 
ftdi_context *ftdi)
 static void _usb_async_cleanup(struct ftdi_context *ftdi, int wait_for_more, 
int timeout_msec)
 {
     struct timeval tv;
-    struct usbdevfs_urb *urb=NULL;
+    struct usbdevfs_urb *urb;
     int ret;
     fd_set writefds;
     int keep_going=0;
@@ -1345,6 +1345,9 @@ static void _usb_async_cleanup(struct ftdi_context *ftdi, 
int wait_for_more, int
 
     do
     {
+        ret = -1;
+        urb = NULL;
+
         while (_usb_get_async_urbs_pending(ftdi)
                 && (ret = ioctl(ftdi->usb_dev->fd, USBDEVFS_REAPURBNDELAY, 
&urb)) == -1
                 && errno == EAGAIN)
@@ -1366,7 +1369,6 @@ static void _usb_async_cleanup(struct ftdi_context *ftdi, 
int wait_for_more, int
             urb->usercontext = FTDI_URB_USERCONTEXT_COOKIE;
 
             /* try to get more urbs that are ready now, but don't wait anymore 
*/
-            urb=NULL;
             keep_going=1;
         }
         else


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. v0.18-10-g236e16d, libftdi-git <=