From b62bb4c2b6da7c3391f5346d9e349adfea2d78a2 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Fri, 25 Sep 2009 14:52:19 +0800 Subject: [PATCH] Added position check to VFS_ReadDir --- Kernel/vfs/dir.c | 5 +++++ 1 file changed, 5 insertions(+) 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); -- 2.20.1