cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Crash when trying to download tftp

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 28 Jan 2014 20:39:01 +0100 (CET)

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
Received on 2014-01-28