summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2019-07-03 11:10:44 +0000
committerNoel Power <npower@samba.org>2019-07-08 09:30:09 +0000
commitd759f4aa4b8e660e0745cfed30eb291d9484291d (patch)
tree181d5f9dfd144e8bddafaf81fa0297997165ef93 /lib
parentf3e4a0d904a8d2269b07cf9288e0f4ae12ed2b71 (diff)
downloadsamba-d759f4aa4b8e660e0745cfed30eb291d9484291d.tar.gz
lib/util: clang: Fix 'Null pointer passed as an argument'
Fixes lib/util/iov_buf.c:50:4: warning: Null pointer passed as an argument to a 'nonnull' parameter <--[clang] memcpy(p, iov[i].iov_base, thislen); ^ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'lib')
-rw-r--r--lib/util/iov_buf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/util/iov_buf.c b/lib/util/iov_buf.c
index 132c7a75637..a9224164068 100644
--- a/lib/util/iov_buf.c
+++ b/lib/util/iov_buf.c
@@ -46,7 +46,7 @@ ssize_t iov_buf(const struct iovec *iov, int iovcnt,
}
needed = tmp;
- if (needed <= buflen && thislen > 0) {
+ if ((p != NULL) && needed <= buflen && thislen > 0) {
memcpy(p, iov[i].iov_base, thislen);
p += thislen;
}