Change storage-class of secret_buf to static

Storing the address of a local variable (`secret_buf`)
in non-local memory (`prf_ptr->secret`) can cause a
dangling pointer bug if the address is used after the function returns.
pull/15405/head
Mingjie Shen 2023-04-19 17:07:42 -04:00
parent d0ca14e4fe
commit 1b77cda621
1 changed files with 1 additions and 1 deletions

View File

@ -2095,7 +2095,7 @@ void tls_master_key_cal(tls_heap_t *heap_ptr, sec_suite_t *tls_suite)
{
uint8_t *ptr;
prf_sec_param_t *prf_ptr = shalib_prf_param_get();
uint8_t secret_buf[2 + 16 + 2 + 16];
static uint8_t secret_buf[2 + 16 + 2 + 16];
tr_debug("CAL Master secret:");
//Her have to to be set check is
#ifdef ECC