summaryrefslogtreecommitdiff
path: root/attrib
diff options
context:
space:
mode:
Diffstat (limited to 'attrib')
-rw-r--r--attrib/gattrib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/attrib/gattrib.c b/attrib/gattrib.c
index 270a37ebe..041b9d289 100644
--- 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;
}