Skip to content

Commit 94b370f

Browse files
Rework check to compare only ints.
1 parent 19b99f8 commit 94b370f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sniffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5521,7 +5521,7 @@ static int CheckHeaders(IpInfo* ipInfo, TcpInfo* tcpInfo, const byte* packet,
55215521
*sslBytes = (int)(packet + ipInfo->total - *sslFrame);
55225522

55235523
/* Ensure sslBytes does not exceed the actual size. */
5524-
if (*sslBytes > (int)(length - (*sslFrame - packet))) {
5524+
if (*sslBytes > (int)(length - (ipInfo->length + tcpInfo->length))) {
55255525
SetError(PACKET_HDR_SHORT_STR, error, NULL, 0);
55265526
return WOLFSSL_FATAL_ERROR;
55275527
}

0 commit comments

Comments
 (0)