summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sharpe <sharpe@samba.org>2001-11-21 11:04:49 +0000
committerRichard Sharpe <sharpe@samba.org>2001-11-21 11:04:49 +0000
commite734163ac472f64457ec4bcfd3e9bd364ee91c6c (patch)
treef4e2a108a36dc5cbc044da0625cdb3a949497cd6
parent16ceec46d6e6d908314e12ac0586c49b37a95256 (diff)
downloadsamba-e734163ac472f64457ec4bcfd3e9bd364ee91c6c.tar.gz
samba-e734163ac472f64457ec4bcfd3e9bd364ee91c6c.tar.bz2
samba-e734163ac472f64457ec4bcfd3e9bd364ee91c6c.zip
One more patch from Tom Jansen. Hope I didn't break the tree :-)
(This used to be commit 6d7c0f0bb4cbfdcd9a83416345432e07556f6cfc)
-rw-r--r--source3/libsmb/clientgen.c7
1 files changed, 7 insertions, 0 deletions
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) {