From 958348a4cfd9ec9dbfb6df69643e0de3b800b773 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 4 Dec 2001 22:01:03 +0000 Subject: [PATCH] * net.cc (cygwin_getsockopt): Dereference optlen pointer when passing to __check_null_invalid_struct_errno. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/net.cc | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 6f8fe5b98..b3094d15e 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2001-12-04 David Rothenberger + + * net.cc (cygwin_getsockopt): Dereference optlen pointer when passing + to __check_null_invalid_struct_errno. + 2001-12-03 Christopher Faylor * net.cc (cygwin_getsockopt): Allow NULL optval. diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index 512dd6f73..670126934 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -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 */