git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7e17599
)
s4:tls_tstream: fix partial reads, so that the gnutls layer doesn't read the same...
author
Stefan Metzmacher
<metze@samba.org>
Tue, 14 Dec 2010 14:00:15 +0000
(15:00 +0100)
committer
Stefan Metzmacher
<metze@samba.org>
Tue, 14 Dec 2010 14:52:31 +0000
(15:52 +0100)
metze
source4/lib/tls/tls_tstream.c
patch
|
blob
|
history
diff --git
a/source4/lib/tls/tls_tstream.c
b/source4/lib/tls/tls_tstream.c
index e1137571a54fe1cdccda7a1718b8e67eee1d4f0d..09fe5714ebee359731bb1d0c269e23497f60c60f 100644
(file)
--- a/
source4/lib/tls/tls_tstream.c
+++ b/
source4/lib/tls/tls_tstream.c
@@
-305,12
+305,17
@@
static ssize_t tstream_tls_pull_function(gnutls_transport_ptr ptr,
}
if (tlss->pull.iov.iov_base) {
+ uint8_t *b;
size_t n;
+ b = (uint8_t *)tlss->pull.iov.iov_base;
+
n = MIN(tlss->pull.iov.iov_len, size);
- memcpy(buf,
tlss->pull.iov.iov_base
, n);
+ memcpy(buf,
b
, n);
tlss->pull.iov.iov_len -= n;
+ b += n;
+ tlss->pull.iov.iov_base = (char *)b;
if (tlss->pull.iov.iov_len == 0) {
tlss->pull.iov.iov_base = NULL;
}