summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2014-06-15 20:39:23 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2014-06-15 20:39:23 +0000
commita92394fce55812a7215f98cc7109cd9cf547f15d (patch)
tree42fd97b0808136b58552c8d7f8369991d2184452
parenta922a82345fa0ed6bc11bcfd99e2d4d0b380eef8 (diff)
Use sizeof(struct file *) consistently for memcpy()'ing fd_ofiles.
Pointed out by Jean-Philippe Ouellet.
-rw-r--r--sys/kern/kern_descrip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 484d3c76691..25604fb196e 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_descrip.c,v 1.108 2014/05/15 03:52:25 guenther Exp $ */
+/* $OpenBSD: kern_descrip.c,v 1.109 2014/06/15 20:39:22 matthew Exp $ */
/* $NetBSD: kern_descrip.c,v 1.42 1996/03/30 22:24:38 christos Exp $ */
/*
@@ -956,7 +956,7 @@ fdcopy(struct process *pr)
M_FILEDESC, M_WAITOK);
}
newfdp->fd_nfiles = i;
- memcpy(newfdp->fd_ofiles, fdp->fd_ofiles, i * sizeof(struct file **));
+ memcpy(newfdp->fd_ofiles, fdp->fd_ofiles, i * sizeof(struct file *));
memcpy(newfdp->fd_ofileflags, fdp->fd_ofileflags, i * sizeof(char));
memcpy(newfdp->fd_himap, fdp->fd_himap, NDHISLOTS(i) * sizeof(u_int));
memcpy(newfdp->fd_lomap, fdp->fd_lomap, NDLOSLOTS(i) * sizeof(u_int));