projects
/
platform
/
upstream
/
bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
31ea52b
)
gattrib: Fix passing NULL to memcpy
author
Luiz Augusto von Dentz
<luiz.von.dentz@intel.com>
Tue, 21 Dec 2021 20:48:31 +0000
(12:48 -0800)
committer
Ayush Garg
<ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:38 +0000
(19:08 +0530)
This fixes the following runtime error:
attrib/gattrib.c:198:2: runtime error: null pointer passed as
argument 2, which is declared to never be null
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
attrib/gattrib.c
patch
|
blob
|
history
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;
}