summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-10-08 17:09:33 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-10-08 17:09:33 +0000
commit1f1bdab4119f19d709df33c6b9b6cfb7a24e7a76 (patch)
treee5f1f9571125ccd744044a1a3ffaacfbeb0fa96f
parentc94b212cb190feff808055bcedf7fc548ecb1e84 (diff)
A memset(,0,) -> M_ZERO change which also fixes a possible bug with
malloc'ing one struct size but zero'ing the memory with another struct size. Feedback from todd@ tedu@ miod@
-rw-r--r--sys/xfs/xfs_syscalls-common.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/xfs/xfs_syscalls-common.c b/sys/xfs/xfs_syscalls-common.c
index dc0b1a6da23..e7dae1e49e9 100644
--- a/sys/xfs/xfs_syscalls-common.c
+++ b/sys/xfs/xfs_syscalls-common.c
@@ -496,12 +496,11 @@ remote_pioctl (d_thread_t *p,
struct xfs_message_pioctl *msg = NULL;
struct xfs_message_wakeup_data *msg2;
- msg = malloc(sizeof(struct xfs_message_symlink), M_TEMP, M_WAITOK);
+ msg = malloc(sizeof(*msg), M_TEMP, M_WAITOK | M_ZERO);
if (msg == NULL) {
error = ENOMEM;
goto done;
}
- memset(msg, 0, sizeof(*msg));
if (vp != NULL) {
struct xfs_node *xn;