From: Noel Power Date: Fri, 14 Jun 2019 13:40:28 +0000 (+0000) Subject: lib/dwrap: Fix 'Null pointer passed as an argument to a 'nonnull' parameter ' X-Git-Tag: ldb-2.0.5~189 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd17d50f7cb8747c66e64e788bbd45212410d9c7;p=thirdparty%2Fsamba.git lib/dwrap: Fix 'Null pointer passed as an argument to a 'nonnull' parameter ' Fixes: lib/dbwrap/dbwrap.c:645:4: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] memcpy(p, dbufs[i].dptr, thislen); Signed-off-by: Noel Power Reviewed-by: Gary Lockyer --- 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; }