From 661092147d1a5845de07ac9357a6511e781a2ed9 Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Sun, 13 Jul 2025 22:47:50 +0800 Subject: [PATCH] Fix random function detection with static PIE builds Certain build options didn't like the detection with an no-op. So make it really fetch a random value. Closes #22981. --- src/base/utils/randomlayer_linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/utils/randomlayer_linux.cpp b/src/base/utils/randomlayer_linux.cpp index 81310f3bb..25608139b 100644 --- a/src/base/utils/randomlayer_linux.cpp +++ b/src/base/utils/randomlayer_linux.cpp @@ -45,7 +45,7 @@ namespace RandomLayer() { - if (::getrandom(nullptr, 0, 0) < 0) + if (unsigned char buf = 0; ::getrandom(&buf, sizeof(buf), 0) < 0) { if (errno == ENOSYS) {