This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: getsockopt broken in cygwin 1.3.6-1

Kiran Prakash wrote:
>  It seems that getsockopt is broken in the latest version.

I experienced the same problem with getsockopt() in the distributed
squid package.  I tracked down the problem to a little typo in
winsup/cygwin/  I've included a patch that fixes the problem.

This is the first time I've contributed anything to cygwin.  I've read
the web pages and I think I've included everything required.  Please let
me know if I've done this incorrectly.

Dave Rothenberger

2001-12-04  David Rothenberger  <>

	* (cygwin_getsockopt): Dereference optlen pointer when
	passing to __check_null_invalid_struct_errno.

--- Tue Dec  4 13:24:17 2001
+++      Tue Dec  4 12:54:05 2001
@@ -799,7 +799,7 @@ cygwin_getsockopt (int fd,
   int res = -1;
   const char *name = "error";
   if (!check_null_invalid_struct_errno (optlen)
-      && (!optval || !__check_null_invalid_struct_errno (optval, (unsigned) optlen))
+      && (!optval || !__check_null_invalid_struct_errno (optval, (unsigned) *optlen))
       && h)
       /* For the following debug_printf */

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]