according memory allocation
h_info_size = (payload_ptr->num_modules) * (sizeof(spf_list_node_t) + sizeof(amdb_module_handle_info_t));
alloc_size = sizeof(amdb_context_t) + h_info_size;
In the amdb_load_unload_modules function (line ~287), there is a pointer arithmetic bug caused by operator precedence:
h_info_list = (spf_list_node_t *)context_ptr + 1;
The code should first perform pointer arithmetic on context_ptr (advancing by sizeof(amdb_context_t) to reach the memory location after the amdb_context_t structure), then cast the result to spf_list_node_t *
h_info_list = (spf_list_node_t *)(context_ptr + 1);
according memory allocation
In the amdb_load_unload_modules function (line ~287), there is a pointer arithmetic bug caused by operator precedence:
The code should first perform pointer arithmetic on context_ptr (advancing by sizeof(amdb_context_t) to reach the memory location after the amdb_context_t structure), then cast the result to spf_list_node_t *