diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-04-27 12:02:52 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-04-28 11:41:34 -0700 |
commit | 3b5c0e5ed0763195157ae1eacc2250a935726803 (patch) | |
tree | 9acb73f692cde9803a54bcebbc4db72ae4a331c7 | |
parent | f7a518c855908d11ecaa0716a62ff97feec546ee (diff) | |
download | bluez-3b5c0e5ed0763195157ae1eacc2250a935726803.tar.gz |
shared/util: Fix runtime error
This fixes the following errors:
src/shared/util.c:271:2: runtime error: null pointer passed as argument
2, which is declared to never be null
-rw-r--r-- | src/shared/util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c index d31daacc4..9a4a8d77a 100644 --- a/src/shared/util.c +++ b/src/shared/util.c @@ -268,7 +268,8 @@ void *util_iov_push_mem(struct iovec *iov, size_t len, const void *data) if (!p) return NULL; - memcpy(p, data, len); + if (data) + memcpy(p, data, len); return p; } |