Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/lib/libkern arc4random: fix a bug introduced by rev.1.7.
details: https://anonhg.NetBSD.org/src/rev/2b88aea78b24
branches: trunk
changeset: 569822:2b88aea78b24
user: yamt <yamt%NetBSD.org@localhost>
date: Wed Sep 08 04:06:15 2004 +0000
description:
arc4random: fix a bug introduced by rev.1.7.
actually generate four bytes random value, rather than
leaving a byte always zero.
diffstat:
sys/lib/libkern/arc4random.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (18 lines):
diff -r 2f6e81233ebd -r 2b88aea78b24 sys/lib/libkern/arc4random.c
--- a/sys/lib/libkern/arc4random.c Tue Sep 07 23:56:08 2004 +0000
+++ b/sys/lib/libkern/arc4random.c Wed Sep 08 04:06:15 2004 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: arc4random.c,v 1.11 2003/10/02 10:39:27 itojun Exp $ */
+/* $NetBSD: arc4random.c,v 1.12 2004/09/08 04:06:15 yamt Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -204,7 +204,7 @@
arc4_randrekey();
}
- for (i = 0, ret = 0; i < 24; ret |= arc4_randbyte() << i, i += 8)
+ for (i = 0, ret = 0; i <= 24; ret |= arc4_randbyte() << i, i += 8)
;
return ret;
}
Home |
Main Index |
Thread Index |
Old Index