Backport possible NULL pointer crash fix from master branch
authorThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 28 Jul 2012 16:04:51 +0000 (18:04 +0200)
committerThomas Jarosch <thomas.jarosch@intra2net.com>
Sat, 28 Jul 2012 16:04:51 +0000 (18:04 +0200)
src/ftdi.c

index 980622d..2d47028 100644 (file)
 #endif
 
 #define ftdi_error_return(code, str) do {  \
-        ftdi->error_str = str;             \
+        if ( ftdi )                        \
+            ftdi->error_str = str;         \
+        else                               \
+            fprintf(stderr, str);          \
         return code;                       \
    } while(0);