public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Arjun Shankar <arjun@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc/release/2.35/master] elf: Fix wrong fscanf usage on tst-pldd
Date: Fri, 25 Nov 2022 14:31:04 +0000 (GMT)	[thread overview]
Message-ID: <20221125143104.D8A9738532EA@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2636fbb7efa8ba6ee101fa64f2295e5f118b8d96

commit 2636fbb7efa8ba6ee101fa64f2295e5f118b8d96
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Mar 25 11:16:49 2022 -0300

    elf: Fix wrong fscanf usage on tst-pldd
    
    To take in consideration the extra '\0'.
    
    Checked on x86_64-linux-gnu.
    
    (cherry picked from commit b2cd93fce666fdc8c9a5c64af2741a8a6940ac99)

Diff:
---
 elf/tst-pldd.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/elf/tst-pldd.c b/elf/tst-pldd.c
index f31f9956fa..8916ce5a2e 100644
--- a/elf/tst-pldd.c
+++ b/elf/tst-pldd.c
@@ -113,7 +113,8 @@ do_test (void)
     TEST_VERIFY (out != NULL);
 
     /* First line is in the form of <pid>: <full path of executable>  */
-    TEST_COMPARE (fscanf (out, "%u: " STRINPUT (512), &pid, buffer), 2);
+    TEST_COMPARE (fscanf (out, "%u: " STRINPUT (sizeof (buffer) - 1), &pid,
+			  buffer), 2);
 
     TEST_COMPARE (pid, *target_pid_ptr);
     TEST_COMPARE (strcmp (basename (buffer), "tst-pldd"), 0);

             reply	other threads:[~2022-11-25 14:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 14:31 Arjun Shankar [this message]
2022-11-25 14:31 Arjun Shankar

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=20221125143104.D8A9738532EA@sourceware.org \
    --to=arjun@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).