]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tftp: check and act on tftp_set_timeouts() returning error
authorDaniel Stenberg <daniel@haxx.se>
Thu, 18 Sep 2025 15:32:39 +0000 (17:32 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 18 Sep 2025 15:54:13 +0000 (17:54 +0200)
Reported-by: Joshua Rogers
Ref: https://github.com/curl/curl/pull/18574#issuecomment-3300183302
Closes #18603

lib/tftp.c

index 620ab1e70df87c1ee352f17a93c4eaae2f819a96..84b92ee488270d426057defaced8df8dee782a61 100644 (file)
@@ -962,6 +962,7 @@ static CURLcode tftp_connect(struct Curl_easy *data, bool *done)
   int need_blksize;
   struct connectdata *conn = data->conn;
   const struct Curl_sockaddr_ex *remote_addr = NULL;
+  CURLcode result;
 
   blksize = TFTP_BLKSIZE_DEFAULT;
 
@@ -1013,7 +1014,9 @@ static CURLcode tftp_connect(struct Curl_easy *data, bool *done)
   ((struct sockaddr *)&state->local_addr)->sa_family =
     (CURL_SA_FAMILY_T)(remote_addr->family);
 
-  tftp_set_timeouts(state);
+  result = tftp_set_timeouts(state);
+  if(result)
+    return result;
 
   if(!conn->bits.bound) {
     /* If not already bound, bind to any interface, random UDP port. If it is