mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(cheevos) create a local string var to set the sublabel attribute when calling rcheevos_get_description. This prevents an unintended pointer reassignment and can cause a crash on strlcpy on some platforms
This commit is contained in:
parent
86839db417
commit
ae6e2f5df5
@ -735,10 +735,13 @@ static int action_bind_sublabel_cheevos_entry(
|
|||||||
char *s, size_t len)
|
char *s, size_t len)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_CHEEVOS
|
#ifdef HAVE_CHEEVOS
|
||||||
|
char fetched_sublabel[MENU_SUBLABEL_MAX_LENGTH];
|
||||||
|
fetched_sublabel[0] = '\0';
|
||||||
|
|
||||||
rcheevos_ctx_desc_t desc_info;
|
rcheevos_ctx_desc_t desc_info;
|
||||||
unsigned new_id = type - MENU_SETTINGS_CHEEVOS_START;
|
unsigned new_id = type - MENU_SETTINGS_CHEEVOS_START;
|
||||||
desc_info.idx = new_id;
|
desc_info.idx = new_id;
|
||||||
desc_info.s = s;
|
desc_info.s = fetched_sublabel;
|
||||||
desc_info.len = len;
|
desc_info.len = len;
|
||||||
rcheevos_get_description((rcheevos_ctx_desc_t*) &desc_info);
|
rcheevos_get_description((rcheevos_ctx_desc_t*) &desc_info);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user