* net.cc (cygwin_hstrerror): Allow s == NULL.

(cygwin_rcmd): Add parameter checking.
	(cygwin_rexec): Ditto.
This commit is contained in:
Corinna Vinschen 2001-11-24 21:52:28 +00:00
parent b0fa0e6e0f
commit 21e379455a
1 changed files with 13 additions and 1 deletions

View File

@ -1442,7 +1442,7 @@ cygwin_hstrerror (int err)
extern "C" void extern "C" void
cygwin_herror (const char *s) cygwin_herror (const char *s)
{ {
if (check_null_str (s)) if (s && check_null_str (s))
return; return;
if (cygheap->fdtab.not_open (2)) if (cygheap->fdtab.not_open (2))
return; return;
@ -2197,6 +2197,12 @@ cygwin_rcmd (char **ahost, unsigned short inport, char *locuser,
SOCKET fd2s; SOCKET fd2s;
sigframe thisframe (mainthread); 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; cygheap_fdnew res_fd;
if (res_fd < 0) if (res_fd < 0)
goto done; goto done;
@ -2263,6 +2269,12 @@ cygwin_rexec (char **ahost, unsigned short inport, char *locuser,
SOCKET fd2s; SOCKET fd2s;
sigframe thisframe (mainthread); 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; cygheap_fdnew res_fd;
if (res_fd < 0) if (res_fd < 0)
goto done; goto done;