Index: Makefile.in
===================================================================
RCS file: /cvs/uberbaum/winsup/cygwin/Makefile.in,v
retrieving revision 1.61
diff -u -p -2 -r1.61 Makefile.in
--- Makefile.in	2001/09/12 17:46:35	1.61
+++ Makefile.in	2001/09/13 15:36:32
@@ -200,5 +200,5 @@ new-$(DLL_NAME): $(LDSCRIPT) $(DLL_OFILE
 	-e $(DLL_ENTRY) $(DEF_FILE) $(DLL_OFILES) version.o winver.o \
 	$(DLL_IMPORTS) $(MALLOC_OBJ) $(LIBM) $(LIBC) \
-	-lstdc++ -lgcc -lshell32 -luuid
+	-lgcc -lshell32 -luuid
 
 dll_ofiles: $(DLL_OFILES)
Index: path.cc
===================================================================
RCS file: /cvs/uberbaum/winsup/cygwin/path.cc,v
retrieving revision 1.162
diff -u -p -2 -r1.162 path.cc
--- path.cc	2001/09/07 21:32:04	1.162
+++ path.cc	2001/09/13 15:36:33
@@ -2400,4 +2400,14 @@ symlink (const char *topath, const char 
   SECURITY_ATTRIBUTES sa = sec_none_nih;
 
+  if (topath[0] == 0)
+    {
+      set_errno (EINVAL);
+      goto done;
+    }
+
+  if (check_null_empty_str_errno (topath) ||
+      check_null_empty_str_errno (frompath))
+    goto done;
+
   win32_path.check (frompath, PC_SYM_NOFOLLOW);
   if (allow_winsymlinks && !win32_path.error)
@@ -2416,9 +2426,4 @@ symlink (const char *topath, const char 
   syscall_printf ("symlink (%s, %s)", topath, win32_path.get_win32 ());
 
-  if (topath[0] == 0)
-    {
-      set_errno (EINVAL);
-      goto done;
-    }
   if (strlen (topath) >= MAX_PATH)
     {
@@ -2985,5 +2990,10 @@ char *
 getcwd (char *buf, size_t ulen)
 {
-  return cygheap->cwd.get (buf, 1, 1, ulen);
+  char* res = NULL;
+  if (!buf || ulen == 0)
+    set_errno (EINVAL);
+  else if (!__check_null_invalid_struct_errno (buf, ulen))
+    res = cygheap->cwd.get (buf, 1, 1, ulen);
+  return res;
 }
 
Index: syscalls.cc
===================================================================
RCS file: /cvs/uberbaum/winsup/cygwin/syscalls.cc,v
retrieving revision 1.144
diff -u -p -2 -r1.144 syscalls.cc
--- syscalls.cc	2001/09/12 17:46:36	1.144
+++ syscalls.cc	2001/09/13 15:36:35
@@ -1769,5 +1769,9 @@ ftruncate (int fd, off_t length)
   int res = -1;
 
-  if (cygheap->fdtab.not_open (fd))
+  if (length < 0)
+    {
+      set_errno (EINVAL);
+    }
+  else if (cygheap->fdtab.not_open (fd))
     {
       set_errno (EBADF);
Index: times.cc
===================================================================
RCS file: /cvs/uberbaum/winsup/cygwin/times.cc,v
retrieving revision 1.22
diff -u -p -2 -r1.22 times.cc
--- times.cc	2001/09/12 17:46:36	1.22
+++ times.cc	2001/09/13 15:36:35
@@ -53,4 +53,7 @@ times (struct tms * buf)
   FILETIME creation_time, exit_time, kernel_time, user_time;
 
+  if (check_null_invalid_struct_errno (buf))
+    return ((clock_t) -1);
+
   DWORD ticks = GetTickCount ();
   /* Ticks is in milliseconds, convert to our ticks. Use long long to prevent
Index: uname.cc
===================================================================
RCS file: /cvs/uberbaum/winsup/cygwin/uname.cc,v
retrieving revision 1.14
diff -u -p -2 -r1.14 uname.cc
--- uname.cc	2001/09/12 17:46:37	1.14
+++ uname.cc	2001/09/13 15:36:35
@@ -22,4 +22,8 @@ uname (struct utsname *name)
   DWORD len;
   SYSTEM_INFO sysinfo;
+
+  if (check_null_invalid_struct_errno (name))
+    return -1;
+    
   char *snp = strstr  (cygwin_version.dll_build_date, "SNP");
 
