mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
Prevent null pointer dereferences
This commit is contained in:
parent
e321d34d08
commit
01ab13f62c
1 changed files with 11 additions and 8 deletions
|
@ -1352,6 +1352,8 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||
info[i].types[j].id);
|
||||
}
|
||||
|
||||
if (system)
|
||||
{
|
||||
free(system->ports.data);
|
||||
system->ports.data = (struct retro_controller_info*)
|
||||
calloc(i, sizeof(*system->ports.data));
|
||||
|
@ -1361,6 +1363,7 @@ bool rarch_environment_cb(unsigned cmd, void *data)
|
|||
memcpy(system->ports.data, info,
|
||||
i * sizeof(*system->ports.data));
|
||||
system->ports.size = i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue