avformat/ftp: Check string used for RNTO

Found-by: Forgejo Fairy
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4d24cb1c39)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2026-05-28 21:37:38 +02:00
parent afdbf03027
commit 6c5dad52b2
+4
View File
@@ -1171,6 +1171,10 @@ static int ftp_move(URLContext *h_src, URLContext *h_dst)
av_url_split(0, 0, 0, 0, 0, 0, 0,
path, sizeof(path),
h_dst->filename);
if (is_bad_string(path)) {
ret = AVERROR(EINVAL);
goto cleanup;
}
ret = snprintf(command, sizeof(command), "RNTO %s\r\n", path);
if (ret >= sizeof(command)) {
ret = AVERROR(ENOSYS);