public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] elf: Fix wrong fscanf usage on tst-pldd
@ 2022-03-29 20:33 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2022-03-29 20:33 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=980f5969344116bd0ba3e46c9359e6112e77f444

commit 980f5969344116bd0ba3e46c9359e6112e77f444
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.

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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-29 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-29 20:33 [glibc/azanella/clang] elf: Fix wrong fscanf usage on tst-pldd 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).