From e734163ac472f64457ec4bcfd3e9bd364ee91c6c Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Wed, 21 Nov 2001 11:04:49 +0000 Subject: One more patch from Tom Jansen. Hope I didn't break the tree :-) (This used to be commit 6d7c0f0bb4cbfdcd9a83416345432e07556f6cfc) --- source3/libsmb/clientgen.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source3') diff --git a/source3/libsmb/clientgen.c b/source3/libsmb/clientgen.c index 133408dff4..0f1fa2e42e 100644 --- a/source3/libsmb/clientgen.c +++ b/source3/libsmb/clientgen.c @@ -38,6 +38,10 @@ recv an smb BOOL cli_receive_smb(struct cli_state *cli) { BOOL ret; + + /* fd == -1 causes segfaults -- Tom (tom@ninja.nl) */ + if (cli->fd == -1) return False; + again: ret = client_receive_smb(cli->fd,cli->inbuf,cli->timeout); @@ -78,6 +82,9 @@ BOOL cli_send_smb(struct cli_state *cli) size_t nwritten=0; ssize_t ret; + /* fd == -1 causes segfaults -- Tom (tom@ninja.nl) */ + if (cli->fd == -1) return False; + len = smb_len(cli->outbuf) + 4; while (nwritten < len) { -- cgit