tftp.c: fix possible dereference of null pointer
authorMarc Hoersken <info@marc-hoersken.de>
Fri, 18 Apr 2014 21:53:48 +0000 (23:53 +0200)
committerMarc Hoersken <info@marc-hoersken.de>
Fri, 18 Apr 2014 21:53:48 +0000 (23:53 +0200)
lib/tftp.c

index 269d10f..03a84e6 100644 (file)
@@ -1320,7 +1320,10 @@ static CURLcode tftp_do(struct connectdata *conn, bool *done)
     if(code)
       return code;
   }
+
   state = (tftp_state_data_t *)conn->proto.tftpc;
+  if(!state)
+    return CURLE_BAD_CALLING_ORDER;
 
   code = tftp_perform(conn, done);