public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] stdlib: Fix tst-getrandom memcmp call
@ 2022-03-31 12:15 Adhemerval Zanella
0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2022-03-31 12:15 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7f2ddf7400bb959897a5fe58f7fc5fbe5e57cfae
commit 7f2ddf7400bb959897a5fe58f7fc5fbe5e57cfae
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-31 12:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31 12:15 [glibc] stdlib: Fix tst-getrandom memcmp call Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).