From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id BFFE13888816 for ; Thu, 31 Mar 2022 12:15:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BFFE13888816 Received: by mail-oi1-x229.google.com with SMTP id t21so20151028oie.11 for ; Thu, 31 Mar 2022 05:15:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=7ZB4UUSRpQB/luWR7+Ab5TFzsNpcOTXxkHqn0mKmHs4=; b=Y7qjG9+bRTeD5oALKGbRq6nl10MBK8T++ZfLyeTZDAZ+ungsc5Qpk7fHqvbsPQx66H Tyc3nmvNZA9SavKmIYmewEbXO8Xsb5JR+Wh1Y6TK9eL6x3hVyL86GXuuOKydPljZyAWm CES1XqKICoEMewwc3RaWrSrnk8DMAbweT4lk4B380yDhhMGBnVKcJ4ossvtSOv1bW2rQ Xx+ttx7EamIlvuZzQYTwDiu8IHFZFFMBJ2sg0PoJ0Fnh2IrLnYlDKvX6V2nglyUyRvoF ctupSbwNgxB+y4ETLyh7t3AKUYZmPkQcY139gpXWt+NEBoWamkTMpr41kqYkQ51VBRdL HNkA== X-Gm-Message-State: AOAM532BGRG0AiYk93319mg8SAb2V7/JvpAaHO4wXiNuUKYFzoPJguUN 6cXQpPygcrT26j29Bhoqd0787jz3Gc59cQ== X-Google-Smtp-Source: ABdhPJztcFdZs2zdctypYPHDJfHsU6Zyj5CeY2mR1JMpAJ7Q+2nHRjFzw8ZLJWjMFunqBwgHzOEvoQ== X-Received: by 2002:a05:6808:1526:b0:2ec:f5ea:39a7 with SMTP id u38-20020a056808152600b002ecf5ea39a7mr2430832oiw.175.1648728951871; Thu, 31 Mar 2022 05:15:51 -0700 (PDT) Received: from birita.. ([2804:431:c7cb:a6c0:4bba:d935:c74c:f625]) by smtp.gmail.com with ESMTPSA id r25-20020a4aea99000000b0032447305d70sm11585859ooh.23.2022.03.31.05.15.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 05:15:51 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Subject: [COMMITTED] stdlib: Fix tst-getrandom memcmp call Date: Thu, 31 Mar 2022 09:15:48 -0300 Message-Id: <20220331121548.1551709-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Mar 2022 12:15:55 -0000 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. --- 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; -- 2.32.0