diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-11-24 21:52:28 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-11-24 21:52:28 +0000 |
commit | 21e379455ae6ab0f58ba55c5df3498363825ab7e (patch) | |
tree | 2791e915b42463fff5d63e72c475be52b92b60a7 /winsup/cygwin/net.cc | |
parent | b0fa0e6e0fa6aa7162e13661eefcda3a7dde3422 (diff) | |
download | newlib-21e379455ae6ab0f58ba55c5df3498363825ab7e.zip newlib-21e379455ae6ab0f58ba55c5df3498363825ab7e.tar.gz newlib-21e379455ae6ab0f58ba55c5df3498363825ab7e.tar.bz2 |
* net.cc (cygwin_hstrerror): Allow s == NULL.
(cygwin_rcmd): Add parameter checking.
(cygwin_rexec): Ditto.
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r-- | winsup/cygwin/net.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index f2259a8..ca19fae 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -1442,7 +1442,7 @@ cygwin_hstrerror (int err) extern "C" void cygwin_herror (const char *s) { - if (check_null_str (s)) + if (s && check_null_str (s)) return; if (cygheap->fdtab.not_open (2)) return; @@ -2197,6 +2197,12 @@ cygwin_rcmd (char **ahost, unsigned short inport, char *locuser, SOCKET fd2s; sigframe thisframe (mainthread); + if (check_null_invalid_struct_errno (ahost) || + check_null_empty_str_errno (*ahost) || + (locuser && check_null_empty_str_errno (locuser)) || + (remuser && check_null_str_errno (remuser))) + return (int) INVALID_SOCKET; + cygheap_fdnew res_fd; if (res_fd < 0) goto done; @@ -2263,6 +2269,12 @@ cygwin_rexec (char **ahost, unsigned short inport, char *locuser, SOCKET fd2s; sigframe thisframe (mainthread); + if (check_null_invalid_struct_errno (ahost) || + check_null_empty_str_errno (*ahost) || + (locuser && check_null_empty_str_errno (locuser)) || + (password && check_null_str_errno (password))) + return (int) INVALID_SOCKET; + cygheap_fdnew res_fd; if (res_fd < 0) goto done; |