mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
network_receive_save_set_flag sanity checks (#24)
This commit is contained in:
parent
90b071acc0
commit
3826d379e9
1 changed files with 2 additions and 2 deletions
|
|
@ -29,12 +29,12 @@ void network_receive_save_set_flag(struct Packet* p) {
|
||||||
packet_read(p, &flags, sizeof(u32));
|
packet_read(p, &flags, sizeof(u32));
|
||||||
packet_read(p, &backupSlot, sizeof(u8));
|
packet_read(p, &backupSlot, sizeof(u8));
|
||||||
|
|
||||||
if (fileIndex >= NUM_SAVE_FILES) {
|
if (fileIndex < 0 || fileIndex >= NUM_SAVE_FILES) {
|
||||||
LOG_ERROR("Invalid fileIndex: %d", fileIndex);
|
LOG_ERROR("Invalid fileIndex: %d", fileIndex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (courseIndex >= COURSE_COUNT) {
|
if (courseIndex < 0 || courseIndex >= COURSE_COUNT) {
|
||||||
LOG_ERROR("Invalid courseIndex: %d", courseIndex);
|
LOG_ERROR("Invalid courseIndex: %d", courseIndex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue