port UBFIXes from emerald

This commit is contained in:
Kurausukun committed 2021-06-26 22:51:41 -04:00
1 parent 8116790c08
commit 88bd618496
8 files changed
+65 -7

No files matched your search

+4
View File
@@ -1628,7 +1628,11 @@ static bool32 IsPartnerActivityAcceptable(u32 activity, u32 group)
if (group == 0xFF)
return TRUE;
#ifndef UBFIX
if (group <= NELEMS(sAcceptedActivityIds)) // UB: <= may access data outside the array
#else
if (group < NELEMS(sAcceptedActivityIds))
#endif
{
const u8 *bytes = sAcceptedActivityIds[group];