From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 74BB03838024; Thu, 31 Mar 2022 12:15:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74BB03838024 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc] stdlib: Fix tst-getrandom memcmp call X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/master X-Git-Oldrev: 3ff447f7dfcb79740e30f6247c1d4d5344244a35 X-Git-Newrev: 7f2ddf7400bb959897a5fe58f7fc5fbe5e57cfae Message-Id: <20220331121532.74BB03838024@sourceware.org> Date: Thu, 31 Mar 2022 12:15:32 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2022 12:15:32 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7f2ddf7400bb959897a5fe58f7fc5fbe5e57cfae commit 7f2ddf7400bb959897a5fe58f7fc5fbe5e57cfae Author: Adhemerval Zanella Date: Thu Mar 24 15:17:12 2022 -0300 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: --- stdlib/tst-getrandom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/tst-getrandom.c b/stdlib/tst-getrandom.c index 608fc4746e..61c3cae92e 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;