From a64e037429f20873ec48f6c82aa145ab448e1399 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 30 Oct 2025 23:05:57 +0100 Subject: [PATCH] avformat/rtmpproto_ Check tcurl and flashver length Fixes: out of array accesses Reviewed-by: Joshua Rogers Signed-off-by: Michael Niedermayer --- libavformat/rtmpproto.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index 4f866eb76c..5de3bebc62 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -2859,6 +2859,12 @@ reconnect: "FMLE/3.0 (compatible; %s)", LIBAVFORMAT_IDENT); } } + if ( strlen(rt->flashver) > FLASHVER_MAX_LENGTH + || strlen(rt->tcurl ) > TCURL_MAX_LENGTH + ) { + ret = AVERROR(EINVAL); + goto fail; + } rt->receive_report_size = 1048576; rt->bytes_read = 0;