tftp: error requests for blank filenames

Reported-by: Joshua Rogers
Closes #19033
This commit is contained in:
Daniel Stenberg 2025-10-12 11:38:39 +02:00
parent 1feeda422e
commit e90b2aaa7e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -460,6 +460,10 @@ static CURLcode tftp_send_first(struct tftp_conn *state,
/* As RFC3617 describes the separator slash is not actually part of the
filename so we skip the always-present first letter of the path
string. */
if(!state->data->state.up.path[1]) {
failf(data, "Missing filename");
return CURLE_TFTP_ILLEGAL;
}
result = Curl_urldecode(&state->data->state.up.path[1], 0,
&filename, NULL, REJECT_ZERO);
if(result)