From dc0e09b41c0de295e1c5d902a52343259130e76f Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 23 Sep 2011 10:46:48 +1000 Subject: - deraadt@cvs.openbsd.org 2008/07/22 21:47:45 [mktemp.c] use arc4random_uniform(); ok djm millert --- openbsd-compat/mktemp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openbsd-compat/mktemp.c') diff --git a/openbsd-compat/mktemp.c b/openbsd-compat/mktemp.c index 5529bee75..5bdf3e6d9 100644 --- a/openbsd-compat/mktemp.c +++ b/openbsd-compat/mktemp.c @@ -1,7 +1,7 @@ /* THIS FILE HAS BEEN MODIFIED FROM THE ORIGINAL OPENBSD SOURCE */ /* Changes: Removed mktemp */ -/* $OpenBSD: mktemp.c,v 1.20 2007/10/21 11:09:30 tobias Exp $ */ +/* $OpenBSD: mktemp.c,v 1.21 2008/07/22 21:47:45 deraadt Exp $ */ /* * Copyright (c) 1987, 1993 * The Regents of the University of California. All rights reserved. @@ -103,7 +103,7 @@ _gettemp(path, doopen, domkdir, slen) while (trv >= path && *trv == 'X') { char c; - pid = (arc4random() & 0xffff) % (26+26); + pid = arc4random_uniform(26+26); if (pid < 26) c = pid + 'A'; else -- cgit v1.2.3