summaryrefslogtreecommitdiff
path: root/lib/dbwrap
diff options
context:
space:
mode:
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;
}