NetBSD-Bugs archive

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

Re: lib/56824 (modulo by 0 in arc4random_uniform())



The following reply was made to PR lib/56824; it has been noted by GNATS.

From: Guilherme Janczak <guilherme.janczak%yandex.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: lib-bug-people%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost,
	gnats-admin%netbsd.org@localhost, joerg%netbsd.org@localhost
Subject: Re: lib/56824 (modulo by 0 in arc4random_uniform())
Date: Sun, 8 May 2022 22:58:46 +0000

 On Sun, May 08, 2022 at 10:40:10PM +0000, joerg%NetBSD.org@localhost wrote:
 > Synopsis: modulo by 0 in arc4random_uniform()
 >
 > State-Changed-From-To: open->closed
 > State-Changed-By: joerg%NetBSD.org@localhost
 > State-Changed-When: Sun, 08 May 2022 22:40:10 +0000
 > State-Changed-Why:
 > This is not a bug. You are asking for a number in the range [0, 0), which is empty.
 > A domain error is the correct result.
 >
 That's true, but arc4random_uniform comes from OpenBSD and their version
 returns 0 in this case. Wouldn't it make more sense to imitate OpenBSD
 behavior than to introduce different behavior?
 



Home | Main Index | Thread Index | Old Index