public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] elf: Fix a wrong array access on tst-tls20
Date: Fri, 16 Jul 2021 11:34:26 +0000 (GMT)	[thread overview]
Message-ID: <20210716113426.4CDBA385AC31@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=881b68e45c3a518319dcf5a3c4a2b3ec59e1c1e5

commit 881b68e45c3a518319dcf5a3c4a2b3ec59e1c1e5
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Jul 16 08:32:05 2021 -0300

    elf: Fix a wrong array access on tst-tls20
    
    Check on x86_64-linux-gnu with --enable-stack-protector=all.

Diff:
---
 elf/tst-tls20.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/elf/tst-tls20.c b/elf/tst-tls20.c
index d8d04fe574..831c3336c9 100644
--- a/elf/tst-tls20.c
+++ b/elf/tst-tls20.c
@@ -226,12 +226,12 @@ do_test_dependency (void)
       int mods[nmods];
       /* We use '0' as indication for a gap, to avoid the dlclose on iteration
 	 cleanup.  */
-      for (int n = 1; n <= nmods; n++)
+      for (int n = 1; n < nmods; n++)
 	{
 	  load_mod (n);
 	   mods[n] = n;
 	}
-      for (int n = 1; n <= nmods; n++)
+      for (int n = 1; n < nmods; n++)
 	{
 	  if (!is_mod_set (g, n))
 	    {
@@ -304,12 +304,12 @@ do_test_invalid_dependency (bool bind_now)
       int mods[nmods];
       /* We use '0' as indication for a gap, to avoid the dlclose on iteration
 	 cleanup.  */
-      for (int n = 1; n <= nmods; n++)
+      for (int n = 1; n < nmods; n++)
 	{
 	  load_mod (n);
 	   mods[n] = n;
 	}
-      for (int n = 1; n <= nmods; n++)
+      for (int n = 1; n < nmods; n++)
 	{
 	  if (!is_mod_set (g, n))
 	    {


                 reply	other threads:[~2021-07-16 11:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210716113426.4CDBA385AC31@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).