mirror of
https://github.com/devkitPro/wut.git
synced 2026-04-23 01:37:20 -05:00
libwhb: Use an aligned buffer size for WHBReadWholeFile to avoid potential heap corruption (#212)
This commit is contained in:
parent
616ebe1a06
commit
b23f9bde00
|
|
@ -138,9 +138,9 @@ WHBReadWholeFile(const char *path,
|
|||
goto error;
|
||||
}
|
||||
|
||||
buf = MEMAllocFromDefaultHeapEx(size, 64);
|
||||
buf = MEMAllocFromDefaultHeapEx((size + 0x3F) & ~(0x3F), 64);
|
||||
if (!buf) {
|
||||
WHBLogPrintf("%s: MEMAllocFromDefaultHeapEx(0x%X, 64) failed", __FUNCTION__, size);
|
||||
WHBLogPrintf("%s: MEMAllocFromDefaultHeapEx(0x%X, 64) failed", __FUNCTION__, (size + 0x3F) & ~(0x3F));
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user