chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use memzero(foo, length); for all memset(foo, 0, length); calls
[elogind.git]
/
src
/
libsystemd
/
sd-bus
/
bus-message.c
diff --git
a/src/libsystemd/sd-bus/bus-message.c
b/src/libsystemd/sd-bus/bus-message.c
index 4e95226c5d7b231d516b50369c183d64f3b892cd..323413406a4e278d062d99d678feb5155e54aeda 100644
(file)
--- a/
src/libsystemd/sd-bus/bus-message.c
+++ b/
src/libsystemd/sd-bus/bus-message.c
@@
-194,7
+194,7
@@
static void *message_extend_fields(sd_bus_message *m, size_t align, size_t sz, b
/* Zero out padding */
if (start > old_size)
/* Zero out padding */
if (start > old_size)
- mem
set((uint8_t*) np + old_size, 0
, start - old_size);
+ mem
zero((uint8_t*) np + old_size
, start - old_size);
op = m->header;
m->header = np;
op = m->header;
m->header = np;
@@
-252,7
+252,7
@@
static int message_append_field_string(
return -ENOMEM;
p[0] = h;
return -ENOMEM;
p[0] = h;
- mem
set(p+1, 0
, 7);
+ mem
zero(p+1
, 7);
memcpy(p+8, s, l);
p[8+l] = 0;
p[8+l+1] = 0;
memcpy(p+8, s, l);
p[8+l] = 0;
p[8+l+1] = 0;
@@
-337,7
+337,7
@@
static int message_append_field_uint32(sd_bus_message *m, uint8_t h, uint32_t x)
return -ENOMEM;
p[0] = h;
return -ENOMEM;
p[0] = h;
- mem
set(p+1, 0
, 7);
+ mem
zero(p+1
, 7);
*((uint32_t*) (p + 8)) = x;
p[12] = 0;
p[13] = 'u';
*((uint32_t*) (p + 8)) = x;
p[12] = 0;
p[13] = 'u';
@@
-1228,7
+1228,7
@@
static void *message_extend_body(sd_bus_message *m, size_t align, size_t sz, boo
return NULL;
if (padding > 0) {
return NULL;
if (padding > 0) {
- mem
set(p, 0
, padding);
+ mem
zero(p
, padding);
p = (uint8_t*) p + padding;
}
p = (uint8_t*) p + padding;
}
@@
-2514,7
+2514,7
@@
_public_ int sd_bus_message_append_array_iovec(
if (iov[i].iov_base)
memcpy(p, iov[i].iov_base, iov[i].iov_len);
else
if (iov[i].iov_base)
memcpy(p, iov[i].iov_base, iov[i].iov_len);
else
- mem
set(p, 0
, iov[i].iov_len);
+ mem
zero(p
, iov[i].iov_len);
p = (uint8_t*) p + iov[i].iov_len;
}
p = (uint8_t*) p + iov[i].iov_len;
}
@@
-2779,7
+2779,7
@@
int bus_message_seal(sd_bus_message *m, uint64_t cookie, usec_t timeout) {
l = BUS_MESSAGE_FIELDS_SIZE(m);
a = ALIGN8(l) - l;
if (a > 0)
l = BUS_MESSAGE_FIELDS_SIZE(m);
a = ALIGN8(l) - l;
if (a > 0)
- mem
set((uint8_t*) BUS_MESSAGE_FIELDS(m) + l, 0
, a);
+ mem
zero((uint8_t*) BUS_MESSAGE_FIELDS(m) + l
, a);
/* If this is something we can send as memfd, then let's seal
the memfd now. Note that we can send memfds as payload only
/* If this is something we can send as memfd, then let's seal
the memfd now. Note that we can send memfds as payload only