Skip to content

Commit 21d5f58

Browse files
committed
Fixed a possible random memory write
1 parent 82898b1 commit 21d5f58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/GameSrc/invent.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1870,7 +1870,7 @@ ubyte add_to_some_page(ObjID obj, uchar select) {
18701870
}
18711871
if (pop != ADD_REJECT) {
18721872
if (pop != ADD_NOEFFECT) {
1873-
if (dpy->pgnum != inventory_page) {
1873+
if (dpy->pgnum != inventory_page && dpy->pgnum < NUM_PAGE_BUTTONS) {
18741874
page_button_state[dpy->pgnum] = BttnFlashOn;
18751875
}
18761876
INVENT_CHANGED;

0 commit comments

Comments
 (0)