diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-09-23 13:47:10 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-09-23 13:47:10 -0700 |
commit | 6c712030567b76e4ea29adbd816c0e5cc994a45c (patch) | |
tree | 0ac8d4649599283f898871c3292875ea5da14780 /client | |
parent | 15895e401e1e29821b67bdc9d12d3bfa67333b35 (diff) | |
download | bluez-6c712030567b76e4ea29adbd816c0e5cc994a45c.tar.gz |
client/gatt: Fix scan-build warning
This fixes the following warning:
client/gatt.c:2146:2: warning: Null pointer passed to 2nd parameter
expecting 'nonnull' [core.NonNullParamChecker]
memcpy(*dst_value + offset, src_val, src_len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Diffstat (limited to 'client')
-rw-r--r-- | client/gatt.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/client/gatt.c b/client/gatt.c index 25d593ffe..8f2920269 100644 --- a/client/gatt.c +++ b/client/gatt.c @@ -2143,7 +2143,8 @@ static int write_value(size_t *dst_len, uint8_t **dst_value, uint8_t *src_val, *dst_value = g_realloc(*dst_value, *dst_len); } - memcpy(*dst_value + offset, src_val, src_len); + if (src_val && src_len) + memcpy(*dst_value + offset, src_val, src_len); return 0; } |