summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2009-05-05 00:01:50 +0200
committerLennart Poettering <lennart@poettering.net>2009-05-20 02:09:31 +0200
commitcbf0874f018c6ddd831de26b1ac5bcf7b517e2da (patch)
tree23d5293ecbe3c230ac7dcc08a34e96becc700584
parentc200e0304d6f53a0fd47f524386b02b27c0c45f6 (diff)
memset: replace memset() by _DBUS_ZERO where applicable
-rw-r--r--bus/desktop-file.c2
-rw-r--r--dbus/dbus-md5.c2
-rw-r--r--dbus/dbus-sha.c2
-rw-r--r--dbus/dbus-sysdeps-unix.c8
-rw-r--r--dbus/dbus-sysdeps-win.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/bus/desktop-file.c b/bus/desktop-file.c
index 2ba77292..e925b2ea 100644
--- a/bus/desktop-file.c
+++ b/bus/desktop-file.c
@@ -330,7 +330,7 @@ new_line (BusDesktopFileParser *parser)
line = &section->lines[section->n_lines++];
- memset (line, 0, sizeof (BusDesktopFileLine));
+ _DBUS_ZERO(*line);
return line;
}
diff --git a/dbus/dbus-md5.c b/dbus/dbus-md5.c
index 589c8d2a..8405f360 100644
--- a/dbus/dbus-md5.c
+++ b/dbus/dbus-md5.c
@@ -451,7 +451,7 @@ _dbus_md5_final (DBusMD5Context *context,
/* some kind of security paranoia, though it seems pointless
* to me given the nonzeroed stuff flying around
*/
- memset ((void*)context, '\0', sizeof (DBusMD5Context));
+ _DBUS_ZERO(*context);
return TRUE;
}
diff --git a/dbus/dbus-sha.c b/dbus/dbus-sha.c
index 8ec50b6f..eb3439f8 100644
--- a/dbus/dbus-sha.c
+++ b/dbus/dbus-sha.c
@@ -465,7 +465,7 @@ _dbus_sha_final (DBusSHAContext *context,
/* some kind of security paranoia, though it seems pointless
* to me given the nonzeroed stuff flying around
*/
- memset ((void*)context, '\0', sizeof (DBusSHAContext));
+ _DBUS_ZERO(*context);
return TRUE;
}
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index 3312bd17..07db1c5f 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -1382,13 +1382,13 @@ write_credentials_byte (int server_fd,
iov.iov_base = buf;
iov.iov_len = 1;
- memset (&msg, 0, sizeof (msg));
+ _DBUS_ZERO(msg);
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
msg.msg_control = &cmsg;
msg.msg_controllen = sizeof (cmsg);
- memset (&cmsg, 0, sizeof (cmsg));
+ _DBUS_ZERO(cmsg);
cmsg.hdr.cmsg_len = sizeof (cmsg);
cmsg.hdr.cmsg_level = SOL_SOCKET;
cmsg.hdr.cmsg_type = SCM_CREDS;
@@ -1498,12 +1498,12 @@ _dbus_read_credentials_socket (int client_fd,
iov.iov_base = &buf;
iov.iov_len = 1;
- memset (&msg, 0, sizeof (msg));
+ _DBUS_ZERO(msg);
msg.msg_iov = &iov;
msg.msg_iovlen = 1;
#if defined(HAVE_CMSGCRED) || defined(LOCAL_CREDS)
- memset (&cmsg, 0, sizeof (cmsg));
+ _DBUS_ZERO(cmsg);
msg.msg_control = &cmsg;
msg.msg_controllen = sizeof (cmsg);
#endif
diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c
index a67e502a..507f2c00 100644
--- a/dbus/dbus-sysdeps-win.c
+++ b/dbus/dbus-sysdeps-win.c
@@ -2616,7 +2616,7 @@ static void dump_backtrace_for_thread(HANDLE hThread)
DPRINTF("Backtrace:\n");
- memset(&context, 0, sizeof(context));
+ _DBUS_ZERO(context);
context.ContextFlags = CONTEXT_FULL;
SuspendThread(hThread);
@@ -2628,7 +2628,7 @@ static void dump_backtrace_for_thread(HANDLE hThread)
return;
}
- memset(&sf, 0, sizeof(sf));
+ _DBUS_ZERO(sf);
#ifdef __i386__
sf.AddrFrame.Offset = context.Ebp;