port UBFIXes from emerald

This commit is contained in:
Kurausukun
2021-06-26 04:04:22 -04:00
parent 8116790c08
commit 88bd618496
8 changed files with 65 additions and 7 deletions
+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];