summaryrefslogtreecommitdiff
path: root/lib/dbwrap
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-05-03 15:42:42 +0200
committerJeremy Allison <jra@samba.org>2019-05-08 16:33:25 +0000
commit30abea8815113045b7ee075352c415fe176a48fe (patch)
tree188604204f4c343c25fa12b04ddf718f89ccd4d0 /lib/dbwrap
parent2b957bde5a2f0f670ee0c8acde6edae1f4aaf253 (diff)
downloadsamba-30abea8815113045b7ee075352c415fe176a48fe.tar.gz
dbwrap: Fix tdb_data_buf()
IIRC there are platforms that don't like memcpy() with len=0. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/dbwrap')
-rw-r--r--lib/dbwrap/dbwrap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c
index 79c83b1a5e2..ff6c9224905 100644
--- a/lib/dbwrap/dbwrap.c
+++ b/lib/dbwrap/dbwrap.c
@@ -643,7 +643,7 @@ static ssize_t tdb_data_buf(const TDB_DATA *dbufs, int num_dbufs,
}
needed = tmp;
- if (needed <= buflen) {
+ if ((thislen != 0) && (needed <= buflen)) {
memcpy(p, dbufs[i].dptr, thislen);
p += thislen;
}