Yes that would fix the problem. 

I see that it was included in 7.35.0, thanks for the quick turnaround.

Glenn

-----Original Message-----
From: curl-library [mailto:[email protected]] On Behalf Of 
Daniel Stenberg
Sent: 28 January 2014 19:39
To: libcurl development
Subject: Re: Crash when trying to download tftp

On Tue, 28 Jan 2014, Glenn Sheridan (glsherid) wrote:

> A simple fix for this would be to check for NULL in tftp_done.
>
> I'm not sure if I need to open a bug against this or if I can be more help.

You mean like this?

diff --git a/lib/tftp.c b/lib/tftp.c
index 5b473d7..8dfcc7c 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -1041,7 +1041,8 @@ static CURLcode tftp_done(struct connectdata *conn, 
CURLcode status,
      return CURLE_ABORTED_BY_CALLBACK;

    /* If we have encountered an error */
-  code = tftp_translate_code(state->error);
+  if(state)
+    code = tftp_translate_code(state->error);

    return code;
  }


-- 

  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to