diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b1f6708ef..2783c3f75 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2002-07-02 Christopher Faylor + + * net.cc (cygwin_getpeername): Defend against NULL pointer dereference. + 2002-07-02 Egor Duda * include/cygwin/version.h: Bump API minor version. diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc index c54dc7eed..870bf7865 100644 --- a/winsup/cygwin/net.cc +++ b/winsup/cygwin/net.cc @@ -1131,7 +1131,7 @@ cygwin_getpeername (int fd, struct sockaddr *name, int *len) if (fh) res = fh->getpeername (name, len); - syscall_printf ("%d = getpeername %d", res, fh->get_socket ()); + syscall_printf ("%d = getpeername %d", res, (fh ? fh->get_socket () : -1)); return res; }