diff options
author | Noel Power <noel.power@suse.com> | 2019-06-14 13:40:28 +0000 |
---|---|---|
committer | Noel Power <npower@samba.org> | 2019-06-26 10:30:23 +0000 |
commit | fd17d50f7cb8747c66e64e788bbd45212410d9c7 (patch) | |
tree | b16749a9c00c0a9156b3ddfa83df14e1194b6483 /lib/dbwrap | |
parent | 37add5c8ce705f9a2d0ab77d6ef07885d72463c7 (diff) | |
download | samba-fd17d50f7cb8747c66e64e788bbd45212410d9c7.tar.gz |
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 <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'lib/dbwrap')
-rw-r--r-- | lib/dbwrap/dbwrap.c | 2 |
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; } |