Added position check to VFS_ReadDir
authorJohn Hodge <[email protected]>
Fri, 25 Sep 2009 06:52:19 +0000 (14:52 +0800)
committerJohn Hodge <[email protected]>
Fri, 25 Sep 2009 06:52:19 +0000 (14:52 +0800)
Kernel/vfs/dir.c

index 043d49c..b7af755 100644 (file)
@@ -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);
        

UCC git Repository :: git.ucc.asn.au