From e6976fc3269dfda5d9975df6af0b35f3033f0f6b Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Wed, 16 Jan 2013 12:21:15 +0000 Subject: [PATCH] fix FAT folder delete in some rare cases git-svn-id: svn://kolibrios.org@3174 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/fs/fat32.inc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/kernel/trunk/fs/fat32.inc b/kernel/trunk/fs/fat32.inc index ec75ea077..35db54c14 100644 --- a/kernel/trunk/fs/fat32.inc +++ b/kernel/trunk/fs/fat32.inc @@ -2845,6 +2845,10 @@ fat_Delete: mov eax, esi call get_FAT jc .err1 + cmp eax, 2 + jb .error_fat + cmp eax, [ebp+FAT.fatRESERVED] + jae .empty mov esi, eax xor ecx, ecx @@: @@ -2865,6 +2869,13 @@ fat_Delete: push ERROR_DEVICE pop eax ret +.error_fat: + popad + pop edi + call fat_unlock + push ERROR_FAT_TABLE + pop eax + ret .notempty: popad .access_denied2: