Skip to content

Commit 07c8c5c

Browse files
sanity check on length before ato16 with SRTP
1 parent a05f4f4 commit 07c8c5c

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
@@ -5685,6 +5685,12 @@ static int TLSX_UseSRTP_Parse(WOLFSSL* ssl, const byte* input, word16 length,
56855685
/* parse remainder one profile at a time, looking for match in CTX */
56865686
ret = 0;
56875687
for (i=offset; i<length; i+=OPAQUE16_LEN) {
5688+
if (length < (i + OPAQUE16_LEN)) {
5689+
WOLFSSL_MSG("Unexpected length when parsing SRTP profile");
5690+
ret = BUFFER_ERROR;
5691+
break;
5692+
}
5693+
56885694
ato16(input+i, &profile_value);
56895695
/* find first match */
56905696
if (profile_value < 16 &&

0 commit comments

Comments
 (0)