mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
Fix in sniffer for possible use of uninitialized length when skipPartial
is set. ZD 12010
This commit is contained in:
@ -4828,7 +4828,7 @@ static int CheckPreRecord(IpInfo* ipInfo, TcpInfo* tcpInfo,
|
|||||||
word32 length;
|
word32 length;
|
||||||
WOLFSSL* ssl = ((*session)->flags.side == WOLFSSL_SERVER_END) ?
|
WOLFSSL* ssl = ((*session)->flags.side == WOLFSSL_SERVER_END) ?
|
||||||
(*session)->sslServer : (*session)->sslClient;
|
(*session)->sslServer : (*session)->sslClient;
|
||||||
byte skipPartial = ((*session)->flags.side == WOLFSSL_SERVER_END) ?
|
byte skipPartial = ((*session)->flags.side == WOLFSSL_SERVER_END) ?
|
||||||
(*session)->flags.srvSkipPartial :
|
(*session)->flags.srvSkipPartial :
|
||||||
(*session)->flags.cliSkipPartial;
|
(*session)->flags.cliSkipPartial;
|
||||||
/* remove SnifferSession on 2nd FIN or RST */
|
/* remove SnifferSession on 2nd FIN or RST */
|
||||||
@ -4865,7 +4865,8 @@ static int CheckPreRecord(IpInfo* ipInfo, TcpInfo* tcpInfo,
|
|||||||
|
|
||||||
/* if current partial data, add to end of partial */
|
/* if current partial data, add to end of partial */
|
||||||
/* if skipping, the data is already at the 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);
|
Trace(PARTIAL_ADD_STR);
|
||||||
|
|
||||||
if ( (*sslBytes + length) > ssl->buffers.inputBuffer.bufferSize) {
|
if ( (*sslBytes + length) > ssl->buffers.inputBuffer.bufferSize) {
|
||||||
|
Reference in New Issue
Block a user