Bug 1389263 - Fix possibly uninitialized value 'curve' in ssl_ecdh_unittest.cc r=franziskus
authorTim Taubert <ttaubert@mozilla.com>
Fri, 11 Aug 2017 11:38:55 +0200
changeset 13527 431b37b7225c1ec796e7381bf37702070a643f55
parent 13526 8019abedc833059e7333aadb269a2412fe6a14f5
child 13528 d83f2573b84eccb40a6e517340b488e7d2ad538b
push id2320
push userttaubert@mozilla.com
push dateFri, 11 Aug 2017 12:13:09 +0000
reviewersfranziskus
bugs1389263
Bug 1389263 - Fix possibly uninitialized value 'curve' in ssl_ecdh_unittest.cc r=franziskus Differential Revision: https://nss-review.dev.mozaws.net/D404
gtests/ssl_gtest/ssl_ecdh_unittest.cc
--- a/gtests/ssl_gtest/ssl_ecdh_unittest.cc
+++ b/gtests/ssl_gtest/ssl_ecdh_unittest.cc
@@ -546,17 +546,17 @@ class ECCServerKEXFilter : public TlsHan
                                                DataBuffer *output) {
     if (header.handshake_type() != kTlsHandshakeServerKeyExchange) {
       return KEEP;
     }
 
     // Replace the server key exchange message with an empty point
     output->Allocate(4);
     output->Write(0, 3U, 1);  // named curve
-    uint32_t curve;
+    uint32_t curve = 0;
     EXPECT_TRUE(input.Read(1, 2, &curve));  // get curve id
     output->Write(1, curve, 2);             // write curve id
     output->Write(3, 0U, 1);                // point length 0
     return CHANGE;
   }
 };
 
 TEST_P(TlsConnectGenericPre13, ConnectECDHEmptyServerPoint) {