Skip to content

Commit 433c6d1

Browse files
authored
Merge pull request #1152 from GmEsoft/GmEsoft_Fix_devhd.c
Fixed potential out-of-bounds array access in Kernel/platform/platform-trs80/devhd.c
2 parents 65596f2 + e8f1770 commit 433c6d1

File tree

1 file changed

+1
-1
lines changed
  • Kernel/platform/platform-trs80

1 file changed

+1
-1
lines changed

Kernel/platform/platform-trs80/devhd.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ int hd_open(uint8_t minor, uint16_t flag)
167167
{
168168
uint8_t dev = minor >> 4;
169169
flag;
170-
if (dev > MAX_HD || parts[dev].g.head == 0 ||
170+
if (dev >= MAX_HD || parts[dev].g.head == 0 ||
171171
(minor && parts[dev].cyl[(minor-1)&0x0F] == 0xFFFF)) {
172172
udata.u_error = ENODEV;
173173
return -1;

0 commit comments

Comments
 (0)