From: John Hodge Date: Fri, 25 Sep 2009 06:52:19 +0000 (+0800) Subject: Added position check to VFS_ReadDir X-Git-Tag: rel0.06~510 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=b62bb4c2b6da7c3391f5346d9e349adfea2d78a2;p=tpg%2Facess2.git Added position check to VFS_ReadDir --- diff --git a/Kernel/vfs/dir.c b/Kernel/vfs/dir.c index 043d49cc..b7af755b 100644 --- a/Kernel/vfs/dir.c +++ b/Kernel/vfs/dir.c @@ -148,6 +148,11 @@ int VFS_ReadDir(int FD, char *Dest) return 0; } + if(h->Position >= h->Node->Size) { + LEAVE('i', 0); + return 0; + } + tmp = h->Node->ReadDir(h->Node, h->Position); LOG("tmp = '%s'", tmp);