From 4f2f3061db404ac09fbbcc671c5bac780a2b4ede Mon Sep 17 00:00:00 2001 From: Marty Dill Date: Tue, 12 Nov 2002 00:45:16 +0000 Subject: [PATCH] CreateDirectoryExW: Fail gracefully if directory name is null/empty. svn path=/trunk/; revision=3744 --- reactos/lib/kernel32/file/dir.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/reactos/lib/kernel32/file/dir.c b/reactos/lib/kernel32/file/dir.c index 61f780d51ef..7c64605c3aa 100644 --- a/reactos/lib/kernel32/file/dir.c +++ b/reactos/lib/kernel32/file/dir.c @@ -1,4 +1,4 @@ -/* $Id: dir.c,v 1.31 2002/09/08 10:22:41 chorns Exp $ +/* $Id: dir.c,v 1.32 2002/11/12 00:45:16 mdill Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS system libraries @@ -138,6 +138,13 @@ CreateDirectoryExW ( DPRINT ("lpTemplateDirectory %S lpNewDirectory %S lpSecurityAttributes %p\n", lpTemplateDirectory, lpNewDirectory, lpSecurityAttributes); + + // Can't create empty directory + if(lpNewDirectory == NULL || *lpNewDirectory == 0) + { + SetLastError(ERROR_PATH_NOT_FOUND); + return FALSE; + } if (lpTemplateDirectory != NULL && *lpTemplateDirectory != 0) {