File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -3116,14 +3116,19 @@ int mbedtls_ssl_prepare_handshake_record(mbedtls_ssl_context *ssl)
31163116 * after the explicit IV, but here we move it to start where the
31173117 * IV was.
31183118 */
3119- if (payload_end + ssl -> in_hsfraglen > ssl -> in_buf + ssl -> in_buf_len ) {
3119+ #if defined(MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH )
3120+ size_t const in_buf_len = ssl -> in_buf_len ;
3121+ #else
3122+ size_t const in_buf_len = MBEDTLS_SSL_IN_BUFFER_LEN ;
3123+ #endif
3124+ if (payload_end + ssl -> in_hsfraglen > ssl -> in_buf + in_buf_len ) {
31203125 MBEDTLS_SSL_DEBUG_MSG (1 ,
31213126 ("Shouldn't happen: no room to move handshake fragment %"
31223127 MBEDTLS_PRINTF_SIZET " from %p to %p (buf=%p len=%"
31233128 MBEDTLS_PRINTF_SIZET ")" ,
31243129 ssl -> in_msglen ,
31253130 ssl -> in_msg , payload_end ,
3126- ssl -> in_buf , ssl -> in_buf_len ));
3131+ ssl -> in_buf , in_buf_len ));
31273132 return MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED ;
31283133 }
31293134 memmove (payload_end , ssl -> in_msg , ssl -> in_msglen );
You can’t perform that action at this time.
0 commit comments