Skip to content

Commit ec9b2c0

Browse files
Confirm sessIdSz's size in DoTls13ServerHello before it is used.
Thanks to Zou Dikai for the report.
1 parent b573823 commit ec9b2c0

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/tls13.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5371,7 +5371,8 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
53715371

53725372
/* Session id */
53735373
args->sessIdSz = input[args->idx++];
5374-
if ((args->idx - args->begin) + args->sessIdSz > helloSz)
5374+
if (args->sessIdSz > ID_LEN || args->sessIdSz > RAN_LEN ||
5375+
((args->idx - args->begin) + args->sessIdSz > helloSz))
53755376
return BUFFER_ERROR;
53765377
args->sessId = input + args->idx;
53775378
args->idx += args->sessIdSz;

0 commit comments

Comments
 (0)