aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-12-03 20:30:04 +0000
committerChristopher Faylor <me@cgf.cx>2001-12-03 20:30:04 +0000
commitfdbc0502c6af8c5715266bfe215a0e7622cd833a (patch)
treee2a52dccede9d7a9249ab703f96dc2e15d3870d9
parent6147ea9b73af3a0e6d24f05a5482ce2b26cd1ba1 (diff)
downloadnewlib-github/unlabeled-1.90.2.zip
newlib-github/unlabeled-1.90.2.tar.gz
newlib-github/unlabeled-1.90.2.tar.bz2
* net.cc (cygwin_getsockopt): Allow NULL optval.github/unlabeled-1.90.2unlabeled-1.90.2
* path.cc (mount_info::read_cygdrive_info_from_registry): Don't write cygdrive to registry if it doesn't exist. * path.cc (mount_info::conv_to_win32_path): Avoid returning error if cygdrive == '/'. (mount_info::cygdrive_win32_path): Return 0 if invalid cygdrive path.
-rw-r--r--winsup/cygwin/net.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index ca19fae..512dd6f 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -613,11 +613,11 @@ static int get_inet_addr (const struct sockaddr *in, int inlen,
/* exported as sendto: standards? */
extern "C" int
cygwin_sendto (int fd,
- const void *buf,
- int len,
- unsigned int flags,
- const struct sockaddr *to,
- int tolen)
+ const void *buf,
+ int len,
+ unsigned int flags,
+ const struct sockaddr *to,
+ int tolen)
{
int res;
wsock_event wsock_evt;
@@ -684,7 +684,7 @@ cygwin_recvfrom (int fd,
if (__check_null_invalid_struct_errno (buf, (unsigned) len)
|| check_null_invalid_struct_errno (fromlen)
- || __check_null_invalid_struct_errno (from, (unsigned) *fromlen)
+ || (from && __check_null_invalid_struct_errno (from, (unsigned) *fromlen))
|| !h)
res = -1;
else
@@ -735,7 +735,7 @@ cygwin_setsockopt (int fd,
int res = -1;
const char *name = "error";
- if (!__check_invalid_read_ptr_errno (optval, optlen) && h)
+ if ((!optval || !__check_invalid_read_ptr_errno (optval, optlen)) && h)
{
/* For the following debug_printf */
switch (optname)
@@ -799,7 +799,7 @@ cygwin_getsockopt (int fd,
int res = -1;
const char *name = "error";
if (!check_null_invalid_struct_errno (optlen)
- && !__check_null_invalid_struct_errno (optval, (unsigned) optlen)
+ && (!optval || !__check_null_invalid_struct_errno (optval, (unsigned) optlen))
&& h)
{
/* For the following debug_printf */