Skip to content

Commit 2c91ecb

Browse files
authored
Merge pull request #6924 from JacobBarthelmeh/srtp
sanity check on length before ato16 with SRTP
2 parents cc45b31 + 07c8c5c commit 2c91ecb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/tls.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5820,6 +5820,12 @@ static int TLSX_UseSRTP_Parse(WOLFSSL* ssl, const byte* input, word16 length,
58205820
/* parse remainder one profile at a time, looking for match in CTX */
58215821
ret = 0;
58225822
for (i=offset; i<length; i+=OPAQUE16_LEN) {
5823+
if (length < (i + OPAQUE16_LEN)) {
5824+
WOLFSSL_MSG("Unexpected length when parsing SRTP profile");
5825+
ret = BUFFER_ERROR;
5826+
break;
5827+
}
5828+
58235829
ato16(input+i, &profile_value);
58245830
/* find first match */
58255831
if (profile_value < 16 &&

0 commit comments

Comments
 (0)