From 83453db58ddaa2c80157216cb0390a51d5c75744 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Tue, 26 Nov 2024 21:01:33 +1300 Subject: [PATCH] Don't allow reading from channel numbers less than 0 As that results in us trying to read from before the beginning of the file array --- kermit/k95/ckuus7.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kermit/k95/ckuus7.c b/kermit/k95/ckuus7.c index 1eab2fd3..98544592 100644 --- a/kermit/k95/ckuus7.c +++ b/kermit/k95/ckuus7.c @@ -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))