From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 13FAF4F28F for ; Sun, 15 Jun 2025 23:38:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 85FD668D9DB; Mon, 16 Jun 2025 02:37:59 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 9A1CD68D3D7 for ; Mon, 16 Jun 2025 02:37:52 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A245C43971 for ; Sun, 15 Jun 2025 23:37:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1750030671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bKixuPHiG8Ionr1cDwSrVb56wibfQmqPONYC19fVTWU=; b=QAzW3Uldc2snrwRdYYZcHhRSY+l+EHyBFaY504T1IuWsRa+a23zfaVnsOerGMdSNs8jIlD E+tbzWrmhU8p10/PYl7Zzpy9RqV8cKNj1axDz3zp7wA3H953BFLoCjJwZcFlLzfQSTpVvp lYUrgX+SiisAqXf7yn6tR42mXBOP1LV+znpYmPM61oQnCU7rMC5zachYk5K5+59cfhOzey 8cnDabTxQf8vjCO6MNi8Z5d1E3DeZhhjf1RDGdcdLKJdwZSuK+mtVkOO9XxD0DaX6sUK+3 bcnJ2glAoUlLC3aoyJAygXDRjducyAxb7UfS7zuSaUtU4Ctk0YUqSLoWaGz5Ww== Date: Mon, 16 Jun 2025 01:37:50 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250615233750.GC29660@pb2> References: <20250614083350.325419-1-502024330056@smail.nju.edu.cn> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -90 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddugddvhedtfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdluddtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepieegkedtjeduffejhfetgeejtdegteetgfegtdfhjefgvefhteegkeejtddvhfevnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] avformat/rtmpproto: fix rmtp packet leak in gen_connect() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============5885885305503436960==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5885885305503436960== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="OlyRIY9/erHXQxJR" Content-Disposition: inline --OlyRIY9/erHXQxJR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jun 14, 2025 at 05:08:36PM +0800, Zhao Zhili wrote: >=20 >=20 > > On Jun 14, 2025, at 16:33, Lidong Yan wrote: > >=20 > > In libavformat/rtmpproto.c:gen_connect(), if check on string length > > or check on codec fourcc failed, ff_rtmp_packet_create() allocated > > data in pkt would leak. Add ff_rtmp_packet_destory before return error > > code. > >=20 > > Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> > >=20 > > -----BEGIN PGP PUBLIC KEY BLOCK----- > >=20 > > mDMEaEpkmRYJKwYBBAHaRw8BAQdAGwGqH/Dwod+i6kR0/Rhn5GanJ7wK8mM9tWP/ > > W2qu8Ti0HTUwMjAyNDMzMDA1NkBzbWFpbC5uanUuZWR1LmNuiJkEExYKAEEWIQQC > > zskBcOehk1y8GoKZR31bPD+6owUCaEpkmQIbAwUJBaOagAULCQgHAgIiAgYVCgkI > > CwIEFgIDAQIeBwIXgAAKCRCZR31bPD+6o8wHAQCLomsA4XfTd8IdG983gGULUJe/ > > 0432buy4nX7AsAc87QEA+/QIsWTR6XLJaLa1sLSQCsZkb86U3c17JzG9oivL8gW4 > > OARoSmSZEgorBgEEAZdVAQUBAQdAfYrEAWd+6bOXkKvHpFmMvKzxAtlhm6ZQKdAq > > +MlJ7wQDAQgHiHgEGBYKACAWIQQCzskBcOehk1y8GoKZR31bPD+6owUCaEpkmQIb > > DAAKCRCZR31bPD+6ozWxAQC9OFisWrP/hHXUfj8AnC39r5pf5fEBz7lHvFgWNk2b > > XwD7Bl6kvIIW7ReqtgXvcl7u78vEo+e9YeTGTlmAogjpeQk=3D > > =3DrP+W > > -----END PGP PUBLIC KEY BLOCK----- > >=20 > > --- > > libavformat/rtmpproto.c | 2 ++ > > 1 file changed, 2 insertions(+) > >=20 > > diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c > > index 846376e668..dd850f72ed 100644 > > --- a/libavformat/rtmpproto.c > > +++ b/libavformat/rtmpproto.c > > @@ -347,6 +347,7 @@ static int gen_connect(URLContext *s, RTMPContext *= rt) > > if ((fourcc_str_len + 1) % 5 !=3D 0) { > > av_log(s, AV_LOG_ERROR, "Malformed rtmp_enhanched_codecs, " > > "should be of the form hvc1[,av01][,vp09][,...]\n"); > > + ff_rtmp_packet_destroy(&pkt); > > return AVERROR(EINVAL); > > } > >=20 > > @@ -370,6 +371,7 @@ static int gen_connect(URLContext *s, RTMPContext *= rt) > > ff_amf_write_string(&p, fourcc); > > } else { > > av_log(s, AV_LOG_ERROR, "Unsupported codec fourcc, = %.*s\n", 4, fourcc_data); > > + ff_rtmp_packet_destroy(&pkt); > > return AVERROR_PATCHWELCOME; > > } >=20 > LGTM. will apply thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato=20 --OlyRIY9/erHXQxJR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaE9ZSwAKCRBhHseHBAsP q9ujAJ9ECnDjxE1tBKbg6yT8I9CQjs79SwCfXa49bHQZedZuwph03gMOYv9hNUE= =Qn9B -----END PGP SIGNATURE----- --OlyRIY9/erHXQxJR-- --===============5885885305503436960== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============5885885305503436960==--