Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-08-19 04:18:48 +0400
committerChristopher Faylor <me@cgf.cx>2003-08-19 04:18:48 +0400
commit9d7f26eaf41871fafe9b279b134126d00d59c86f (patch)
treeab3c4fb1073cca0bd1ac6b5d2e40863b8cbb8dcc /winsup/cygwin
parentc3b56227ec29f7e52e76a3e2947f515df536f56a (diff)
* path.cc (mount): Add null/empty check for input parameters.
(umount): Add null/empty check for input parameters.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/path.cc7
2 files changed, 11 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index be9f2eb96..3685cda9e 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2003-08-18 Christopher Faylor <cgf@redhat.com>
+
+ * path.cc (mount): Add null/empty check for input parameters.
+ (umount): Add null/empty check for input parameters.
+
2003-08-17 Pierre Humblet <pierre.humblet@ieee.org>
* grp.cc (read_group): Revert previous change.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index bffddce9b..15b3f861e 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2592,7 +2592,10 @@ mount (const char *win32_path, const char *posix_path, unsigned flags)
{
int res = -1;
- if (strpbrk (posix_path, "\\:"))
+ if (check_null_empty_str_errno (win32_path)
+ || check_null_empty_str_errno (posix_path))
+ /* errno set */;
+ else if (strpbrk (posix_path, "\\:"))
set_errno (EINVAL);
else if (flags & MOUNT_CYGDRIVE) /* normal mount */
{
@@ -2617,6 +2620,8 @@ mount (const char *win32_path, const char *posix_path, unsigned flags)
extern "C" int
umount (const char *path)
{
+ if (check_null_empty_str_errno (path))
+ return -1;
return cygwin_umount (path, 0);
}