From e90b2aaa7e9dce64c3d7416b17a7c2feb7208db3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 12 Oct 2025 11:38:39 +0200 Subject: [PATCH] tftp: error requests for blank filenames Reported-by: Joshua Rogers Closes #19033 --- lib/tftp.c | 4 ++++ 1 file changed, 4 insertions(+) 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) -- 2.47.3