Skip to content

Commit 36931c8

Browse files
Ensure the SNI extension has at least OPAQUE16_LEN bytes in TLSX_SNI_GetFromBuffer.
Thanks to Zou Dikai for the report.
1 parent 48a0347 commit 36931c8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/tls.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,6 +2800,9 @@ int TLSX_SNI_GetFromBuffer(const byte* clientHello, word32 helloSz,
28002800
} else {
28012801
word16 listLen;
28022802

2803+
if (extLen < OPAQUE16_LEN)
2804+
return BUFFER_ERROR;
2805+
28032806
ato16(clientHello + offset, &listLen);
28042807
offset += OPAQUE16_LEN;
28052808

0 commit comments

Comments
 (0)