From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id DF8F047F85 for ; Mon, 5 Feb 2024 11:43:05 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BCEC368D109; Mon, 5 Feb 2024 13:43:02 +0200 (EET) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BF51268CA05 for ; Mon, 5 Feb 2024 13:42:56 +0200 (EET) Received: by mail.gandi.net (Postfix) with ESMTPSA id E71531BF20E for ; Mon, 5 Feb 2024 11:42:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1707133376; 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=kUfzutCp22Mvwk3jfS6FHFOZ/KiB/scKfiVHeLmBBPE=; b=fHaF8wTp3J6+r9ZbUfjQiFPneScby8t3u60lYhhPM3Rq2l8ib0AMvCl4riM+tiJroZXQVq 09bhyjaVDfef3aSz+6LQLcWaeelqrg6dRiYFSEuIdep6nsHIKpjdaNIDoD/mxgN34h5wts CggB06+sDZPAPiPn8FM+alJ0x3rgJW4q84Ztzkvf9b6OkA2GOeEFov8VokiDwCCQ0hjpsT lIl7VItUUrYivPfF9GMaV5yIX5K9lfrDa+KFNlTs12V32N+l1VUbxh3xh/STKulS2gUZv7 fB4kOmZhPgOe4w/29NokcgTgDRojeh85E9XmdcbRwHCynV0rn3ml+96n2jMEmw== Date: Mon, 5 Feb 2024 12:42:54 +0100 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240205114254.GR6420@pb2> References: <20240205025823.4259-1-michael@niedermayer.cc> <20240205025823.4259-2-michael@niedermayer.cc> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 2/2] avfilter/signature_lookup: Do not dereference NULL pointers after malloc failure 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="===============1836426546260683823==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1836426546260683823== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="M2DqKoG8sdGtnx+N" Content-Disposition: inline --M2DqKoG8sdGtnx+N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 05, 2024 at 11:35:54AM +0100, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: CID 1403229 Dereference after null check > >=20 > > Signed-off-by: Michael Niedermayer > > --- > > libavfilter/signature_lookup.c | 25 ++++++++++++++----------- > > 1 file changed, 14 insertions(+), 11 deletions(-) > >=20 > > diff --git a/libavfilter/signature_lookup.c b/libavfilter/signature_loo= kup.c > > index 86dd0c66754..6e45fde1b5a 100644 > > --- a/libavfilter/signature_lookup.c > > +++ b/libavfilter/signature_lookup.c > > @@ -37,6 +37,14 @@ > > #define STATUS_END_REACHED 1 > > #define STATUS_BEGIN_REACHED 2 > > =20 > > +static void sll_free(MatchingInfo **sll) > > +{ > > + while (*sll) { > > + sll =3D &(*sll)->next; > > + av_freep(sll); > > + } > > +} > > + >=20 > This will leak every element except the second (if existing) of the > linked list. ill post a better and split patch thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If you fake or manipulate statistics in a paper in physics you will never get a job again. If you fake or manipulate statistics in a paper in medicin you will get a job for life at the pharma industry. --M2DqKoG8sdGtnx+N Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEIAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZcDJtwAKCRBhHseHBAsP q19/AJ9ZzJu5PG42pJ24W/5JiA1K/G5I/wCeNnhbsXVekDVgr7qZlhIWTkmi7Qw= =HalQ -----END PGP SIGNATURE----- --M2DqKoG8sdGtnx+N-- --===============1836426546260683823== 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". --===============1836426546260683823==--