]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tftp: don't pin or check address if recvfrom returns error
authorDaniel Stenberg <daniel@haxx.se>
Mon, 6 Oct 2025 15:23:18 +0000 (17:23 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 6 Oct 2025 21:50:34 +0000 (23:50 +0200)
Follow-up to c4f9977c66bbb05a837a7eb0300
Reported-by: Joshua Rogers
Closes #18892

lib/tftp.c

index b81fd3ee14b57f07a8b72d2696b0b5b796c1d32b..baebe466a10bbc69f7d58ef6ad3d8a4d35edf5ea 100644 (file)
@@ -1105,7 +1105,7 @@ static CURLcode tftp_receive_packet(struct Curl_easy *data,
                                 0,
                                 (struct sockaddr *)&remote_addr,
                                 &fromlen);
-  if(fromlen) {
+  if((state->rbytes >= 0) && fromlen) {
     if(state->remote_pinned) {
       /* pinned, verify that it comes from the same address */
       if((state->remote_addrlen != fromlen) ||