cpp: Return null key if the signature had no key
authorAndre Heinecke <aheinecke@intevation.de>
Mon, 10 Oct 2016 15:36:41 +0000 (17:36 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Mon, 10 Oct 2016 15:36:41 +0000 (17:36 +0200)
* lang/cpp/src/verificationresult.cpp (Private): Add null key
to list when there is no key associated with the signature.

--
This fixes an out of bounds read when a verification did
not have a key.

lang/cpp/src/verificationresult.cpp

index be33ca2..a7b073e 100644 (file)
@@ -72,6 +72,8 @@ public:
             // copy keys
             if (scopy->key) {
                 keys.push_back(Key(scopy->key, true));
+            } else {
+                keys.push_back(Key());
             }
             // copy notations:
             nota.push_back(std::vector<Nota>());