diff options
author | Andrew Tridgell <tridge@samba.org> | 1997-12-02 23:24:26 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1997-12-02 23:24:26 +0000 |
commit | 7b10574429a098cedea689a4b1a0a12854f20758 (patch) | |
tree | e74ad4a2aa7283023effbd8e7f9d27768d58c1ab | |
parent | 0e6a7ca2ec8925806cfc3a4f01b50ebdf5c51e1a (diff) | |
download | samba-7b10574429a098cedea689a4b1a0a12854f20758.tar.gz samba-7b10574429a098cedea689a4b1a0a12854f20758.tar.xz samba-7b10574429a098cedea689a4b1a0a12854f20758.zip |
dont try getpeername() when Client isn't initialised
(This used to be commit a32ca542ad294ecc3848ca511337a8cc994d67be)
-rw-r--r-- | source3/lib/util.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c index 2457dec14dd..f5cae86430a 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3541,6 +3541,10 @@ char *client_name(void) strcpy(name_buf,"UNKNOWN"); + if (Client == -1) { + return name_buf; + } + if (getpeername(Client, &sa, &length) < 0) { DEBUG(0,("getpeername failed\n")); return name_buf; @@ -3579,6 +3583,10 @@ char *client_addr(void) strcpy(addr_buf,"0.0.0.0"); + if (Client == -1) { + return addr_buf; + } + if (getpeername(Client, &sa, &length) < 0) { DEBUG(0,("getpeername failed\n")); return addr_buf; |