File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2930,24 +2930,33 @@ WOLFSSL_SESSION* wolfSSL_d2i_SSL_SESSION(WOLFSSL_SESSION** sess,
29302930#endif
29312931#if defined(HAVE_SESSION_TICKET ) || !defined(NO_PSK )
29322932#ifdef WOLFSSL_TLS13
2933- if (i - idx < (OPAQUE32_LEN * 2 )) {
2933+
2934+ #ifdef WOLFSSL_32BIT_MILLI_TIME
2935+ if (i - idx < OPAQUE32_LEN ) {
29342936 ret = BUFFER_ERROR ;
29352937 goto end ;
29362938 }
2937- #ifdef WOLFSSL_32BIT_MILLI_TIME
29382939 ato32 (data + idx , & s -> ticketSeen );
29392940 idx += OPAQUE32_LEN ;
29402941#else
2942+ if (i - idx < (OPAQUE32_LEN * 2 )) {
2943+ ret = BUFFER_ERROR ;
2944+ goto end ;
2945+ }
29412946 {
29422947 word32 seenHi , seenLo ;
2943-
29442948 ato32 (data + idx , & seenHi );
29452949 idx += OPAQUE32_LEN ;
29462950 ato32 (data + idx , & seenLo );
29472951 idx += OPAQUE32_LEN ;
29482952 s -> ticketSeen = ((sword64 )seenHi << 32 ) + seenLo ;
29492953 }
29502954#endif
2955+
2956+ if (i - idx < OPAQUE32_LEN ) {
2957+ ret = BUFFER_ERROR ;
2958+ goto end ;
2959+ }
29512960 ato32 (data + idx , & s -> ticketAdd );
29522961 idx += OPAQUE32_LEN ;
29532962 if (i - idx < OPAQUE8_LEN ) {
You can’t perform that action at this time.
0 commit comments