mirror of
https://github.com/devkitPro/wut.git
synced 2026-08-17 16:19:18 -05:00
libwhb: Use an aligned buffer size for WHBReadWholeFile to avoid potential heap corruption (#212)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user