summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-01 13:18:35 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-01 13:18:35 +0000
commit4592d107fc01c8cb46f99843529d145d268b35da (patch)
tree1382fb6e57afa9ef0b319c34cdb6d8790950314f /source3/libsmb
parent247acd5521f28a4f932105c9c76699c62f3f95f9 (diff)
downloadsamba-4592d107fc01c8cb46f99843529d145d268b35da.tar.gz
samba-4592d107fc01c8cb46f99843529d145d268b35da.tar.bz2
samba-4592d107fc01c8cb46f99843529d145d268b35da.zip
cli_read() was reading too many bytes.
(This used to be commit ba79d2a030b9ae087f0cc4248baa6cf6bee112fb)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clireadwrite.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index 54d3fd18e3..458532cb2e 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -71,10 +71,9 @@ ssize_t cli_read(struct cli_state *cli, int fnum, char *buf, off_t offset, size_
*/
readsize = (cli->max_xmit - (smb_size+32)) & ~1023;
- if (readsize > size )
- readsize = size;
while (total < size) {
+ readsize = MIN(readsize, size-total);
/* Issue a read and receive a reply */