mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix buffer overflow issue on GameMode.
This commit is contained in:
parent
4b6431f7fe
commit
d5036ff2ae
1 changed files with 6 additions and 0 deletions
|
@ -4313,6 +4313,9 @@ static int sceNetAdhocGameModeCreateMaster(u32 dataAddr, int size) {
|
|||
SceNetEtherAddr localMac;
|
||||
getLocalMac(&localMac);
|
||||
gameModeBuffSize = std::max(gameModeBuffSize, size);
|
||||
u8* buf = (u8*)realloc(gameModeBuffer, gameModeBuffSize);
|
||||
if (buf)
|
||||
gameModeBuffer = buf;
|
||||
|
||||
u8* data = (u8*)malloc(size);
|
||||
if (data) {
|
||||
|
@ -4371,6 +4374,9 @@ static int sceNetAdhocGameModeCreateReplica(const char *mac, u32 dataAddr, int s
|
|||
|
||||
int ret = 0;
|
||||
gameModeBuffSize = std::max(gameModeBuffSize, size);
|
||||
u8* buf = (u8*)realloc(gameModeBuffer, gameModeBuffSize);
|
||||
if (buf)
|
||||
gameModeBuffer = buf;
|
||||
|
||||
u8* data = (u8*)malloc(size);
|
||||
if (data) {
|
||||
|
|
Loading…
Add table
Reference in a new issue