1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

libcli: Use iov_buflen in smbXcli_iov_len

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2015-02-17 20:16:45 +00:00 committed by Jeremy Allison
parent cab45cb765
commit 4c000545c0
2 changed files with 6 additions and 7 deletions

View File

@ -25,6 +25,7 @@
#include "../lib/util/tevent_unix.h" #include "../lib/util/tevent_unix.h"
#include "lib/util/util_net.h" #include "lib/util/util_net.h"
#include "lib/util/dlinklist.h" #include "lib/util/dlinklist.h"
#include "lib/util/iov_buf.h"
#include "../libcli/smb/smb_common.h" #include "../libcli/smb/smb_common.h"
#include "../libcli/smb/smb_seal.h" #include "../libcli/smb/smb_seal.h"
#include "../libcli/smb/smb_signing.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) static size_t smbXcli_iov_len(const struct iovec *iov, int count)
{ {
size_t result = 0; ssize_t ret = iov_buflen(iov, count);
int i;
for (i=0; i<count; i++) { /* Ignore the overflow case for now ... */
result += iov[i].iov_len; return ret;
}
return result;
} }
static uint8_t *smbXcli_iov_concat(TALLOC_CTX *mem_ctx, static uint8_t *smbXcli_iov_concat(TALLOC_CTX *mem_ctx,

View File

@ -46,7 +46,7 @@ def build(bld):
LIBCRYPTO NDR_SMB2_LEASE_STRUCT errors gensec krb5samba LIBCRYPTO NDR_SMB2_LEASE_STRUCT errors gensec krb5samba
smb_transport smb_transport
''', ''',
public_deps='talloc samba-util', public_deps='talloc samba-util iov_buf',
private_library=True, private_library=True,
public_headers=''' public_headers='''
smb_common.h smb2_constants.h smb_constants.h smb_common.h smb2_constants.h smb_constants.h