projects
/
platform
/
upstream
/
bluez.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
gattrib: Fix passing NULL to memcpy
[platform/upstream/bluez.git]
/
attrib
/
gattrib.c
diff --git
a/attrib/gattrib.c
b/attrib/gattrib.c
index
2caa703
..
07f8096
100755
(executable)
--- a/
attrib/gattrib.c
+++ b/
attrib/gattrib.c
@@
-195,7
+195,9
@@
static uint8_t *construct_full_pdu(uint8_t opcode, const void *pdu,
return NULL;
buf[0] = opcode;
- memcpy(buf + 1, pdu, length);
+
+ if (pdu && length)
+ memcpy(buf + 1, pdu, length);
return buf;
}