mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-12-24 17:41:01 +03:00
Fix uninitialized variable in an edge case
If `context_buf = mbedtls_calloc( 1, buf_len )` failed, `context_buf_len` was not initialized. Noticed by `gcc -Os -Werror=maybe-uninitialized`. This was only a problem in ssl_server2 (a test program), only with MBEDTLS_SSL_CONTEXT_SERIALIZATION enabled.
This commit is contained in:
@@ -1820,7 +1820,7 @@ int main( int argc, char *argv[] )
|
||||
#endif
|
||||
#if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION)
|
||||
unsigned char *context_buf = NULL;
|
||||
size_t context_buf_len;
|
||||
size_t context_buf_len = 0;
|
||||
#endif
|
||||
|
||||
int i;
|
||||
|
||||
Reference in New Issue
Block a user