From 4f8ba5ad6ac9b7153b0e13654e59f47e67b3f608 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 13 Nov 2009 10:51:14 +1100 Subject: s4:heimdal: import lorikeet-heimdal-200911122202 (commit 9291fd2d101f3eecec550178634faa94ead3e9a1) --- source4/heimdal/lib/hcrypto/rand-unix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/heimdal/lib/hcrypto/rand-unix.c') diff --git a/source4/heimdal/lib/hcrypto/rand-unix.c b/source4/heimdal/lib/hcrypto/rand-unix.c index 2bfa265fa4..fcad39f1de 100644 --- a/source4/heimdal/lib/hcrypto/rand-unix.c +++ b/source4/heimdal/lib/hcrypto/rand-unix.c @@ -95,8 +95,10 @@ unix_bytes(unsigned char *outdata, int size) ssize_t count; int once = 0; - if (size <= 0) + if (size < 0) return 0; + else if (size == 0) + return 1; HEIMDAL_MUTEX_lock(&random_mutex); if (random_fd == -1) { -- cgit