summary refs log tree commit diff
path: root/stdlib
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-09-29 16:15:20 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-09-30 15:24:49 -0300
commit13db9ee2cb3b77e25f852be7d6952882e1be6f00 (patch)
tree7248da21444c714b89322a372cd0c7ec0247c0fb /stdlib
parent8b10727a9af3e2aa4b27dff0116bb8d3c9afce3d (diff)
downloadglibc-13db9ee2cb3b77e25f852be7d6952882e1be6f00.tar.gz
glibc-13db9ee2cb3b77e25f852be7d6952882e1be6f00.tar.xz
glibc-13db9ee2cb3b77e25f852be7d6952882e1be6f00.zip
stdlib: Fix __getrandom_nocancel type and arc4random usage (BZ #29638)
Using an unsigned type prevents the fallback to be used if kernel
does not support getrandom syscall.

Checked on x86_64-linux-gnu.

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/arc4random.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/arc4random.c b/stdlib/arc4random.c
index e417ef624d..960a38f295 100644
--- a/stdlib/arc4random.c
+++ b/stdlib/arc4random.c
@@ -34,7 +34,7 @@ void
 __arc4random_buf (void *p, size_t n)
 {
   static int seen_initialized;
-  size_t l;
+  ssize_t l;
   int fd;
 
   if (n == 0)