From: Noel Power Date: Thu, 13 Jun 2019 13:39:22 +0000 (+0000) Subject: clang: Fix Null pointer passed as argument warning X-Git-Tag: ldb-2.0.5~192 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf43f1d052a44bea08bef09ea5eace77143c8093;p=thirdparty%2Fsamba.git clang: Fix Null pointer passed as argument warning Fixes: lib/tdb/common/transaction.c:354:2: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] memcpy(tdb->transaction->blocks[blk] + off, buf, len); & Signed-off-by: Noel Power Reviewed-by: Gary Lockyer --- diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c index b67f84f215d..290451b3285 100644 --- a/lib/tdb/common/transaction.c +++ b/lib/tdb/common/transaction.c @@ -330,7 +330,7 @@ static int transaction_write_existing(struct tdb_context *tdb, tdb_off_t off, } } - if (len == 0) { + if (len == 0 || buf == NULL) { return 0; }