Skip to content

Commit

Permalink
Don't allow reading from channel numbers less than 0
Browse files Browse the repository at this point in the history
As that results in us trying to read from before the beginning of the file array
  • Loading branch information
davidrg committed Nov 26, 2024
1 parent dd46500 commit 83453db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kermit/k95/ckuus7.c
Original file line number Diff line number Diff line change
Expand Up @@ -12230,6 +12230,8 @@ z_in(channel,s,buflen,length,flags)
return(z_error = FX_NOP);
if (channel >= z_maxchan)
return(z_error = FX_CHN);
if (channel < 0)
return(z_error = FX_CHN);
if (!z_file[channel])
return(z_error = FX_NOP);
if (!(t = z_file[channel]->z_fp))
Expand Down

0 comments on commit 83453db

Please sign in to comment.