Menu

#286 signed/unsigned error in srcmess/cheat.c

other
open
nobody
None
5
2020-08-31
2020-08-31
Graham Toal
No

building https://github.com/amadvance/advancemame for raspbian:

In function ResizeWatchListNoDispose,
    inlined from DeleteWatchAt.part.25 at srcmess/cheat.c:7613:2:
srcmess/cheat.c:7574:4: warning: memset specified size 4294967012 exceeds maximum object size 2147483647 [-Wstringop-overflow=]
    memset(&watchList[watchListLength], 0, (newLength - watchListLength) * sizeof(WatchInfo));

In function ResizeCheatListNoDispose,
    inlined from DeleteCheatAt.part.33 at srcmess/cheat.c:7382:2:
srcmess/cheat.c:7342:4: warning: memset specified size 4294967268 exceeds maximum object size 2147483647 [-Wstringop-overflow=]
    memset(&cheatList[cheatListLength], 0, (newLength - cheatListLength) * sizeof(CheatEntry));

if the listlength is 0 and newlength is -1, newlength is treated as max unsigned int.

The relevant call is: ResizeCheatListNoDispose(cheatListLength - 1);

Discussion


Log in to post a comment.

MongoDB Logo MongoDB