Bug 1228555 - Move sidLen declaration to top of the scope r=bustage
authorTim Taubert <ttaubert@mozilla.com>
Fri, 11 Mar 2016 12:42:30 +0100
changeset 11983 2fceba406eee8ee058a009783f55c848fed76851
parent 11982 52f57b0c5444cee33ff3417c6ef1f6799d2343ed
child 11986 7947fd4431c579dabf087fd3b4ff1696d773cc4b
push id1056
push userttaubert@mozilla.com
push dateFri, 11 Mar 2016 11:43:34 +0000
reviewersbustage
bugs1228555
Bug 1228555 - Move sidLen declaration to top of the scope r=bustage
lib/ssl/sslinfo.c
--- a/lib/ssl/sslinfo.c
+++ b/lib/ssl/sslinfo.c
@@ -58,26 +58,28 @@ SSL_GetChannelInfo(PRFileDesc *fd, SSLCh
              */
             inf.cipherSuite = ss->ssl3.hs.cipher_suite;
             inf.compressionMethod = ss->ssl3.cwSpec->compression_method;
             ssl_ReleaseSpecReadLock(ss);
             inf.compressionMethodName =
                 ssl_GetCompressionMethodName(inf.compressionMethod);
         }
         if (sid) {
+            unsigned int sidLen;
+
             inf.creationTime = sid->creationTime;
             inf.lastAccessTime = sid->lastAccessTime;
             inf.expirationTime = sid->expirationTime;
             inf.extendedMasterSecretUsed =
                 (ss->version >= SSL_LIBRARY_VERSION_TLS_1_3 ||
                  sid->u.ssl3.keys.extendedMasterSecretUsed)
                     ? PR_TRUE
                     : PR_FALSE;
 
-            unsigned int sidLen = sid->u.ssl3.sessionIDLength;
+            sidLen = sid->u.ssl3.sessionIDLength;
             sidLen = PR_MIN(sidLen, sizeof inf.sessionID);
             inf.sessionIDLength = sidLen;
             memcpy(inf.sessionID, sid->u.ssl3.sessionID, sidLen);
         }
     }
 
     memcpy(info, &inf, inf.length);