From 3f74e149f88fef5419504439e0adee0d517d9033 Mon Sep 17 00:00:00 2001
From: Marc Hoersken <info@marc-hoersken.de>
Date: Fri, 18 Apr 2014 23:53:48 +0200
Subject: [PATCH] tftp.c: fix possible dereference of null pointer

---
 lib/tftp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/tftp.c b/lib/tftp.c
index 269d10f7ad..03a84e6311 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -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);
 
-- 
GitLab