mirror of
https://github.com/libretro/RetroArch.git
synced 2024-12-14 20:59:06 +00:00
fix heap buffer overflow
==16726== ERROR: AddressSanitizer: heap-buffer-overflow on address 0x600400139d99 at pc 0x5cb4d8 bp 0x7ffc88a3a050 sp 0x7ffc88a3a048 READ of size 1 at 0x600400139d99 thread T0 #0 0x5cb4d7 in xmb_update_savestate_thumbnail_path /home/bp/RetroArch/menu/drivers/xmb.c:1071
This commit is contained in:
parent
830b2e429d
commit
daf0b55f80
@ -1068,9 +1068,9 @@ static void xmb_update_savestate_thumbnail_path(void *data, unsigned i)
|
||||
if (!string_is_empty(entry.label))
|
||||
{
|
||||
if ( (settings->bools.savestate_thumbnail_enable)
|
||||
&& ((string_is_equal_fast(entry.label, "state_slot", 10))
|
||||
|| (string_is_equal_fast(entry.label, "loadstate", 9))
|
||||
|| (string_is_equal_fast(entry.label, "savestate", 9))))
|
||||
&& ((string_is_equal(entry.label, "state_slot"))
|
||||
|| (string_is_equal(entry.label, "loadstate"))
|
||||
|| (string_is_equal(entry.label, "savestate"))))
|
||||
{
|
||||
size_t path_size = 8024 * sizeof(char);
|
||||
char *path = (char*)malloc(8204 * sizeof(char));
|
||||
|
Loading…
Reference in New Issue
Block a user