Merge pull request #3956 from dgarske/zd12010

Fix in sniffer for possible use of uninitialized variable
This commit is contained in:
John Safranek
2021-04-20 17:29:46 -07:00
committed by GitHub

View File

@@ -4865,7 +4865,8 @@ static int CheckPreRecord(IpInfo* ipInfo, TcpInfo* tcpInfo,
/* if current partial data, add to end of partial */
/* if skipping, the data is already at the end of partial */
if ( !skipPartial && (length = ssl->buffers.inputBuffer.length) ) {
length = ssl->buffers.inputBuffer.length;
if ( !skipPartial && length ) {
Trace(PARTIAL_ADD_STR);
if ( (*sslBytes + length) > ssl->buffers.inputBuffer.bufferSize) {
@@ -4882,7 +4883,6 @@ static int CheckPreRecord(IpInfo* ipInfo, TcpInfo* tcpInfo,
*sslFrame = ssl->buffers.inputBuffer.buffer;
*end = *sslFrame + *sslBytes;
}
}
if (vChain != NULL) {
#ifdef WOLFSSL_SNIFFER_CHAIN_INPUT
@@ -4923,6 +4923,7 @@ static int CheckPreRecord(IpInfo* ipInfo, TcpInfo* tcpInfo,
#endif
(void)chainSz;
}
}
if ((*session)->flags.clientHello == 0 && **sslFrame != handshake) {
/* Sanity check the packet for an old style client hello. */