[devel] [PATCH for apt 17/38] Fix access after free error

Aleksei Nikiforov darktemplar на altlinux.org
Вт Дек 10 18:23:22 MSK 2019


Found via clang-static-analyzer
---
 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,vector<st
 	    SetCloseExec(STDIN_FILENO,false);
 	    SetCloseExec(STDOUT_FILENO,false);
 	    
+	    std::string arg_0 = _config->Find("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.0



Подробная информация о списке рассылки Devel