From 3599798aac0b89ca8128970253a3489ee0406a6d Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 16 Nov 2018 15:54:19 -0800 Subject: [PATCH] Move a variable declaration to the start of a block instead of in the middle. --- src/sniffer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sniffer.c b/src/sniffer.c index 7e3803475..9aeb42e91 100644 --- a/src/sniffer.c +++ b/src/sniffer.c @@ -3507,14 +3507,16 @@ static int ssl_DecodePacketInternal(const byte* packet, int length, /* Pass back Session Info after we have processed the Server Hello. */ if ((NULL != sslInfo) && (0 != session->sslServer->options.cipherSuite)) { + const char* pCipher; + sslInfo->isValid = 1; sslInfo->protocolVersionMajor = session->sslServer->version.major; sslInfo->protocolVersionMinor = session->sslServer->version.minor; sslInfo->serverCipherSuite0 = session->sslServer->options.cipherSuite0; sslInfo->serverCipherSuite = session->sslServer->options.cipherSuite; - const char* pCipher = wolfSSL_get_cipher(session->sslServer); - if (pCipher) + pCipher = wolfSSL_get_cipher(session->sslServer); + if (NULL != pCipher) XMEMCPY(sslInfo->serverCipherSuiteName, pCipher, sizeof(sslInfo->serverCipherSuiteName) - 1); }