OSDN Git Service

* path.cc (mount): Add null/empty check for input parameters.
authorcgf <cgf>
Tue, 19 Aug 2003 00:18:48 +0000 (00:18 +0000)
committercgf <cgf>
Tue, 19 Aug 2003 00:18:48 +0000 (00:18 +0000)
(umount): Add null/empty check for input parameters.

winsup/cygwin/ChangeLog
winsup/cygwin/path.cc

index be9f2eb..3685cda 100644 (file)
@@ -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.
index bffddce..15b3f86 100644 (file)
@@ -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);
 }