From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on sa.local.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.1 From: Aleksei Nikiforov To: devel@lists.altlinux.org Date: Thu, 12 Dec 2019 12:57:26 +0300 Message-Id: <20191212095730.83787-18-darktemplar@altlinux.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191212095730.83787-1-darktemplar@altlinux.org> References: <20191211234857.GB17949@altlinux.org> <20191212095730.83787-1-darktemplar@altlinux.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: Aleksei Nikiforov Subject: [devel] [PATCH for apt v2 17/21] Fix access after free error X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Dec 2019 09:58:35 -0000 Archived-At: List-Archive: List-Post: Found via clang-static-analyzer: Memory error: Use-after-free: Use of memory after it is freed --- apt/cmdline/rpmindexcopy.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apt/cmdline/rpmindexcopy.cc b/apt/cmdline/rpmindexcopy.cc index 9604d4b..6d5a414 100644 --- a/apt/cmdline/rpmindexcopy.cc +++ b/apt/cmdline/rpmindexcopy.cc @@ -111,8 +111,10 @@ bool RPMIndexCopy::CopyPackages(const string &CDROM,const string &Name,vectorFind("Dir::Bin::bzip2","bzip2"); + const char *Args[3]; - Args[0] = _config->Find("Dir::Bin::bzip2","bzip2").c_str(); + Args[0] = arg_0.c_str(); Args[1] = "-d"; Args[2] = 0; execvp(Args[0],(char **)Args); -- 2.24.1