Skip to content

Commit

Permalink
Fix 2 buffer overflows.
Browse files Browse the repository at this point in the history
  • Loading branch information
antonioginer committed May 12, 2024
1 parent 103e83c commit b3b2b64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion switchres.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ switchres_manager::switchres_manager()
display()->set_monitor("generic_15");
display()->set_modeline("auto");
display()->set_lcd_range("auto");
for (int i = 0; i++ < MAX_RANGES;) display()->set_crt_range(i, "auto");
for (int i = 0; i < MAX_RANGES; i++) display()->set_crt_range(i, "auto");
display()->set_screen("auto");
display()->set_modeline_generation(true);
display()->set_lock_unsupported_modes(true);
Expand Down
2 changes: 1 addition & 1 deletion switchres_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ int main(int argc, char **argv)
monitor_range *range = &switchres.display()->range[mode->range];
edid_from_modeline(mode, range, switchres.display()->monitor(), &edid);

char file_name[strlen(switchres.display()->monitor()) + 4];
char file_name[strlen(switchres.display()->monitor()) + 5];
sprintf(file_name, "%s.bin", switchres.display()->monitor());

FILE *file = fopen(file_name, "wb");
Expand Down

0 comments on commit b3b2b64

Please sign in to comment.