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 7A4FF4971A for ; Sun, 18 Feb 2024 16:57:42 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AF98668D366; Sun, 18 Feb 2024 18:57:40 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id ECEB968D215 for ; Sun, 18 Feb 2024 18:57:33 +0200 (EET) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=IJ3DSJnW; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 607E0240DA9; Sun, 18 Feb 2024 17:57:33 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Be3bUGLdibC6; Sun, 18 Feb 2024 17:57:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1708275452; bh=Eb2hSV6lOSj7zHrC1v3JzHl4M1UHlqJXORIsK9B2bt0=; h=Subject:From:To:Cc:In-Reply-To:References:Date:From; b=IJ3DSJnWD9/p+7u5XFrFyC61K6ZbQ7jjVCLCWrycD6+llZU25NDRaSVpdR4vQaepT Gp2dhMjTDuPY838EqPD0CnvehzSqyMUmIUrVb15dfW2dCWtkfzV797x4KA6Od0gtZY NxPHzVMUxZKcGTWBi2eCC7KE/6MrSy4pivd+XYNdiKOYjw2FPhbog7/yKzlUC/4HqZ YdVBCG0+mKp9wKxPuUGjJKwsagMSmwiEZZ3sJnoaUI4+btidFSQeVm6XNhepAASBVq V2i7rPZCd61kviXGfn6Dka3zx6Ezk7cIZeuKesXQR5txnkL8CJjctMyadtaflvAs0c eCnqZIf40rynw== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id A9308240177; Sun, 18 Feb 2024 17:57:32 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id E11B51601B9; Sun, 18 Feb 2024 17:57:31 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: Mail-Followup-To: FFmpeg development discussions and patches , Andreas Rheinhardt Date: Sun, 18 Feb 2024 17:57:31 +0100 Message-ID: <170827545189.21676.14958420329440505993@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 1/2] fftools/ffmpeg_mux_init: Fix attachment_filename use-after-free 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 Cc: Andreas Rheinhardt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting Andreas Rheinhardt (2024-02-18 16:10:06) > The filename is freed with the OptionsContext and therefore > there will be a use-after-free when reporting the filename > in print_stream_maps(). So create a copy of the string. > > This is a regression since 8aed3911fc454e79697e183660bf30d31334a64b. > fate-lavf-mkv_attachment exhibits it (and reports a random nonsense > filename here), but this does not make the test fail (not even with > valgrind; only with ASAN, as it aborts on use-after-free). > > Signed-off-by: Andreas Rheinhardt > --- > fftools/ffmpeg.h | 2 +- > fftools/ffmpeg_mux.c | 2 ++ > fftools/ffmpeg_mux_init.c | 10 +++++++++- > 3 files changed, 12 insertions(+), 2 deletions(-) Ok -- Anton Khirnov _______________________________________________ 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".