From: Daniel Stenberg Date: Sun, 12 Oct 2025 09:38:39 +0000 (+0200) Subject: tftp: error requests for blank filenames X-Git-Tag: rc-8_17_0-2~101 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e90b2aaa7e9dce64c3d7416b17a7c2feb7208db3;p=thirdparty%2Fcurl.git tftp: error requests for blank filenames Reported-by: Joshua Rogers Closes #19033 --- diff --git a/lib/tftp.c b/lib/tftp.c index 8279f29e65..0a9b8a8e87 100644 --- a/lib/tftp.c +++ b/lib/tftp.c @@ -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)