[devel] [PATCH for apt v2 19/21] Don't use uninitialized value

Aleksei Nikiforov darktemplar на altlinux.org
Чт Дек 12 12:57:28 MSK 2019


Found via clang-static-analyzer:
Logic error: Uninitialized argument value:
'dummy' declared without an initial value
3rd function call argument is an uninitialized value
---
 apt/apt-pkg/rpm/rpmpm.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/apt/apt-pkg/rpm/rpmpm.cc b/apt/apt-pkg/rpm/rpmpm.cc
index eb14363..a6a3837 100644
--- a/apt/apt-pkg/rpm/rpmpm.cc
+++ b/apt/apt-pkg/rpm/rpmpm.cc
@@ -625,7 +625,7 @@ bool pkgRPMExtPM::ExecRPM(Item::RPMOps op, const std::vector<apt_item> &files)
       if (_config->FindB("RPM::FlushSTDIN",true) == true)
       {
 	 int Flags,dummy;
-	 if ((Flags = fcntl(STDIN_FILENO,F_GETFL,dummy)) < 0)
+	 if ((Flags = fcntl(STDIN_FILENO,F_GETFL)) < 0)
 	     _exit(100);
 	 
 	 // Discard everything in stdin before forking dpkg
-- 
2.24.1



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