about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-10-10T13·03+0200
committerEelco Dolstra <edolstra@gmail.com>2019-10-10T13·03+0200
commit61e816217bfdfffd39c130c7cd24f07e640098fc (patch)
treeb1d5c4057a139d1e1b9ac699725224224a4787a1 /src
parent21f48ff26afab05febbc08c0c14617fc47b74d6d (diff)
nix verify: Fix uninitialized variable
(cherry picked from commit 95cf23ee7c5b0fd69b21811989a5668f4261fd51)
Diffstat (limited to 'src')
-rw-r--r--src/nix/verify.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nix/verify.cc b/src/nix/verify.cc
index 7ef571561a0e..8893fded5ed1 100644
--- a/src/nix/verify.cc
+++ b/src/nix/verify.cc
@@ -13,7 +13,7 @@ struct CmdVerify : StorePathsCommand
     bool noContents = false;
     bool noTrust = false;
     Strings substituterUris;
-    size_t sigsNeeded;
+    size_t sigsNeeded = 0;
 
     CmdVerify()
     {
@@ -113,7 +113,7 @@ struct CmdVerify : StorePathsCommand
                     else {
 
                         StringSet sigsSeen;
-                        size_t actualSigsNeeded = sigsNeeded ? sigsNeeded : 1;
+                        size_t actualSigsNeeded = std::max(sigsNeeded, (size_t) 1);
                         size_t validSigs = 0;
 
                         auto doSigs = [&](StringSet sigs) {