Skip to content

Commit

Permalink
Merge pull request ps2dev#685 from uyjulian/iomanx_fd_lower_bounds_check
Browse files Browse the repository at this point in the history
iomanX perform lower bounds check on fd before returning
  • Loading branch information
fjtrujy authored Nov 29, 2024
2 parents 0fa8842 + 21f1876 commit e3bea49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion iop/system/iomanx/src/iomanX.c
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ static iomanX_iop_file_t *new_iob(void)

static iomanX_iop_file_t *get_iob(int fd)
{
if ( ((unsigned int)fd >= (sizeof(file_table) / sizeof(file_table[0]))) || (!file_table[fd].device) )
if ( (fd < 0) || ((unsigned int)fd >= (sizeof(file_table) / sizeof(file_table[0]))) || (!file_table[fd].device) )
return NULL;
return &file_table[fd];
}
Expand Down

0 comments on commit e3bea49

Please sign in to comment.