Skip to content

Commit c70b3f2

Browse files
committed
fix: tls13: don't use stale suites pointers in CheckPreSharedKeys
1 parent 369db53 commit c70b3f2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/tls13.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6064,7 +6064,7 @@ static int CheckPreSharedKeys(WOLFSSL* ssl, const byte* input, word32 helloSz,
60646064
int first = 0;
60656065
#ifndef WOLFSSL_PSK_ONE_ID
60666066
int i;
6067-
const Suites* suites = WOLFSSL_SUITES(ssl);
6067+
const Suites* suites;
60686068
#else
60696069
byte suite[2];
60706070
#endif
@@ -6102,7 +6102,8 @@ static int CheckPreSharedKeys(WOLFSSL* ssl, const byte* input, word32 helloSz,
61026102

61036103
/* Refine list for PSK processing. */
61046104
RefineSuites(ssl, clSuites);
6105-
6105+
/* set after refineSuites, to avoid taking a stale ptr to ctx->Suites */
6106+
suites = WOLFSSL_SUITES(ssl);
61066107
#ifndef WOLFSSL_PSK_ONE_ID
61076108
if (usingPSK == NULL)
61086109
return BAD_FUNC_ARG;

0 commit comments

Comments
 (0)