summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-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) {