summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 29815cb07af..f8eefcca02d 100644
--- a/lib/dbwrap/dbwrap.c
+++ b/lib/dbwrap/dbwrap.c
@@ -642,7 +642,7 @@ static ssize_t tdb_data_buf(const TDB_DATA *dbufs, int num_dbufs,
return -1;
}
- if ((thislen != 0) && (needed <= buflen)) {
+ if (p != NULL && (thislen != 0) && (needed <= buflen)) {
memcpy(p, dbufs[i].dptr, thislen);
p += thislen;
}