more bounds checks in network_receive_save_remove_flag (#25)
This commit is contained in:
parent
0174cfa0fa
commit
933f0812a7
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue