Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/darwin maplen was uninitialized.



details:   https://anonhg.NetBSD.org/src/rev/165470def1fd
branches:  trunk
changeset: 584467:165470def1fd
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Sep 19 02:47:15 2005 +0000

description:
maplen was uninitialized.

diffstat:

 sys/compat/darwin/darwin_mman.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 59fada1d3cc5 -r 165470def1fd sys/compat/darwin/darwin_mman.c
--- a/sys/compat/darwin/darwin_mman.c   Mon Sep 19 02:46:49 2005 +0000
+++ b/sys/compat/darwin/darwin_mman.c   Mon Sep 19 02:47:15 2005 +0000
@@ -1,6 +1,6 @@
 #undef DEBUG_DARWIN
 #undef DEBUG_MACH
-/*     $NetBSD: darwin_mman.c,v 1.18 2005/09/13 01:42:32 christos Exp $ */
+/*     $NetBSD: darwin_mman.c,v 1.19 2005/09/19 02:47:15 christos Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_mman.c,v 1.18 2005/09/13 01:42:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_mman.c,v 1.19 2005/09/19 02:47:15 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -145,7 +145,8 @@
                error = EINVAL;
                goto bad3;
        }
-       mapp = malloc(sizeof(*mapp) * SCARG(uap, count), M_TEMP, M_WAITOK);
+       maplen = SCARG(uap, count) * sizeof(*mapp);
+       mapp = malloc(maplen, M_TEMP, M_WAITOK);
 
        if ((error = copyin(SCARG(uap, mappings), mapp, maplen)) != 0)
                goto bad2;



Home | Main Index | Thread Index | Old Index