diff --git a/src/pc/network/packets/packet_save_remove_flag.c b/src/pc/network/packets/packet_save_remove_flag.c index 179d6e79..db20e1d8 100644 --- a/src/pc/network/packets/packet_save_remove_flag.c +++ b/src/pc/network/packets/packet_save_remove_flag.c @@ -29,12 +29,12 @@ void network_receive_save_remove_flag(struct Packet* p) { packet_read(p, &flagsToRemove, sizeof(u32)); packet_read(p, &backupSlot, sizeof(u8)); - if (fileIndex >= NUM_SAVE_FILES) { + if (fileIndex < 0 || fileIndex >= NUM_SAVE_FILES) { LOG_ERROR("Invalid fileIndex: %d", fileIndex); return; } - if (courseIndex >= COURSE_COUNT) { + if (courseIndex < -1 || courseIndex >= COURSE_COUNT) { LOG_ERROR("Invalid courseIndex: %d", courseIndex); return; }