From: Adhemerval Zanella Date: Thu, 24 Mar 2022 18:17:12 +0000 (-0300) Subject: stdlib: Fix tst-getrandom memcmp call X-Git-Tag: glibc-2.36~414 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7f2ddf7400bb959897a5fe58f7fc5fbe5e57cfae;p=thirdparty%2Fglibc.git stdlib: Fix tst-getrandom memcmp call The idea is to check if the up sizeof (buf) are equal, not only the first byte. Checked on x86_64-linux-gnu and i686-linux-gnu. --- diff --git a/stdlib/tst-getrandom.c b/stdlib/tst-getrandom.c index 608fc4746ee..61c3cae92e5 100644 --- a/stdlib/tst-getrandom.c +++ b/stdlib/tst-getrandom.c @@ -189,7 +189,7 @@ test_getentropy (void) /* The probability that these two buffers are equal is very small. */ - if (memcmp (buf, buf2, sizeof (buf) == 0)) + if (memcmp (buf, buf2, sizeof (buf)) == 0) { printf ("error: getentropy appears to return constant bytes\n"); errors = true;