tftp: don't pin or check address if recvfrom returns error

Follow-up to c4f9977c66
Reported-by: Joshua Rogers
Closes #18892
This commit is contained in:
Daniel Stenberg 2025-10-06 17:23:18 +02:00
parent 1a3a5cb720
commit f1ed50a517
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View 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) ||