1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-03 12:58:35 +03:00

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>
This commit is contained in:
Noel Power 2019-06-14 13:40:28 +00:00 committed by Noel Power
parent 37add5c8ce
commit fd17d50f7c

View File

@ -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;
}