From 30abea8815113045b7ee075352c415fe176a48fe Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 3 May 2019 15:42:42 +0200 Subject: dbwrap: Fix tdb_data_buf() IIRC there are platforms that don't like memcpy() with len=0. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- lib/dbwrap/dbwrap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/dbwrap') 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; } -- cgit v1.2.1