mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-22 10:45:36 +01:00
Describe the behaviour of buffer resizing on an out-of-memory error
Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
parent
cd9a6ff3c1
commit
2e49d079d6
@ -1912,7 +1912,11 @@
|
||||
/**
|
||||
* \def MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
|
||||
*
|
||||
* Enable modifying the maximum I/O buffer size.
|
||||
* Enable modifying the maximum I/O buffer size in runtime.
|
||||
*
|
||||
* If the library runs out of memory during the resizing of an I/O buffer,
|
||||
* there is no error returned. The operation continues as usual on an
|
||||
* unchanged buffer without any negative impact on the flow.
|
||||
*/
|
||||
//#define MBEDTLS_SSL_VARIABLE_BUFFER_LENGTH
|
||||
|
||||
|
@ -685,6 +685,8 @@ static void handle_buffer_resizing( mbedtls_ssl_context *ssl, int downsizing,
|
||||
{
|
||||
if( resize_buffer( &ssl->in_buf, in_buf_new_len, &ssl->in_buf_len ) != 0 )
|
||||
{
|
||||
/* No need to return an error here; The buffer will remain as
|
||||
* is with no negative impact on the flow. */
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "input buffer resizing failed - out of memory" ) );
|
||||
}
|
||||
else
|
||||
@ -705,6 +707,8 @@ static void handle_buffer_resizing( mbedtls_ssl_context *ssl, int downsizing,
|
||||
{
|
||||
if( resize_buffer( &ssl->out_buf, out_buf_new_len, &ssl->out_buf_len ) != 0 )
|
||||
{
|
||||
/* No need to return an error here; The buffer will remain as
|
||||
* is with no negative impact on the flow. */
|
||||
MBEDTLS_SSL_DEBUG_MSG( 1, ( "output buffer resizing failed - out of memory" ) );
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user