summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-02-17 20:16:45 +0000
committerJeremy Allison <jra@samba.org>2015-02-24 17:52:09 +0100
commit4c000545c00943993b5d814f14e8112abd19975f (patch)
tree598d286d3cdebfbd82984ce54e8ff639a3e390e6 /libcli
parentcab45cb7654e978ac7ad50a12de35cf2728cb10c (diff)
downloadsamba-4c000545c00943993b5d814f14e8112abd19975f.tar.gz
libcli: Use iov_buflen in smbXcli_iov_len
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/smb/smbXcli_base.c11
-rwxr-xr-xlibcli/smb/wscript2
2 files changed, 6 insertions, 7 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 8aa60201901..f8d4df3c14f 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -25,6 +25,7 @@
#include "../lib/util/tevent_unix.h"
#include "lib/util/util_net.h"
#include "lib/util/dlinklist.h"
+#include "lib/util/iov_buf.h"
#include "../libcli/smb/smb_common.h"
#include "../libcli/smb/smb_seal.h"
#include "../libcli/smb/smb_signing.h"
@@ -1115,12 +1116,10 @@ void smb1cli_req_set_seqnum(struct tevent_req *req, uint32_t seqnum)
static size_t smbXcli_iov_len(const struct iovec *iov, int count)
{
- size_t result = 0;
- int i;
- for (i=0; i<count; i++) {
- result += iov[i].iov_len;
- }
- return result;
+ ssize_t ret = iov_buflen(iov, count);
+
+ /* Ignore the overflow case for now ... */
+ return ret;
}
static uint8_t *smbXcli_iov_concat(TALLOC_CTX *mem_ctx,
diff --git a/libcli/smb/wscript b/libcli/smb/wscript
index 48fa2b4e261..dad98215709 100755
--- a/libcli/smb/wscript
+++ b/libcli/smb/wscript
@@ -46,7 +46,7 @@ def build(bld):
LIBCRYPTO NDR_SMB2_LEASE_STRUCT errors gensec krb5samba
smb_transport
''',
- public_deps='talloc samba-util',
+ public_deps='talloc samba-util iov_buf',
private_library=True,
public_headers='''
smb_common.h smb2_constants.h smb_constants.h