Skip to content

Commit d7437d7

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

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
@@ -5353,7 +5353,8 @@ int DoTls13ServerHello(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
53535353

53545354
/* Session id */
53555355
args->sessIdSz = input[args->idx++];
5356-
if ((args->idx - args->begin) + args->sessIdSz > helloSz)
5356+
if (args->sessIdSz > ID_LEN || args->sessIdSz > RAN_LEN ||
5357+
((args->idx - args->begin) + args->sessIdSz > helloSz))
53575358
return BUFFER_ERROR;
53585359
args->sessId = input + args->idx;
53595360
args->idx += args->sessIdSz;

0 commit comments

Comments
 (0)