projects
/
platform
/
core
/
system
/
kdbus-bus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bbbe6f8
)
metadata: allow NULL pointers in kdbus_meta_append_data()
author
Daniel Mack
<zonque@gmail.com>
Fri, 15 Aug 2014 17:46:10 +0000
(19:46 +0200)
committer
Daniel Mack
<zonque@gmail.com>
Fri, 15 Aug 2014 20:11:03 +0000
(22:11 +0200)
Allow NULL pointers to be passed as data argument to
kdbus_meta_append_data(), so users can use the function to only make space
in the metadata without actually copying any payload.
metadata.c
patch
|
blob
|
history
diff --git
a/metadata.c
b/metadata.c
index 267bb4918cacac3977eae11448b1421f7d1cf4e9..b2b27e614916561c4cea739149fa424e391532ba 100644
(file)
--- a/
metadata.c
+++ b/
metadata.c
@@
-162,7
+162,8
@@
int kdbus_meta_append_data(struct kdbus_meta *meta, u64 type,
item->type = type;
item->size = KDBUS_ITEM_HEADER_SIZE + len;
- memcpy(item->data, data, len);
+ if (data)
+ memcpy(item->data, data, len);
return 0;
}