*/
int FDD_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX])
{
- if(Pos < 0 || Pos > MAX_DISKS )
+ if(Pos < 0 || Pos >= MAX_DISKS )
return -ENOENT;
if(!gaFDD_Disks[Pos].bValid)
return 1;
if( Name[1] != '\0' ) return NULL;
pos = Name[0] - '0';
+ if( pos >= MAX_DISKS ) return NULL;
return &gaFDD_DiskNodes[pos];
}