This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.26.9000-1004-g5983df3


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  5983df320af003a10ab2b965db1eecaca92c7056 (commit)
      from  1421f39b7eadd3b5fbd2a3f2da1fc006b69fbc42 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5983df320af003a10ab2b965db1eecaca92c7056

commit 5983df320af003a10ab2b965db1eecaca92c7056
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Mon Dec 18 22:54:01 2017 +0000

    Fix truncation warnings in posix/tst-glob_symlinks.c.
    
    The test posix/tst-glob_symlinks.c fails to build with GCC mainline:
    
    tst-glob_symlinks.c: In function 'do_test':
    tst-glob_symlinks.c:124:30: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
       snprintf (buf, sizeof buf, "%s?", dangling_link);
                                  ^~~~~
    tst-glob_symlinks.c:124:3: note: 'snprintf' output between 2 and 4097 bytes into a destination of size 4096
       snprintf (buf, sizeof buf, "%s?", dangling_link);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    tst-glob_symlinks.c:128:30: error: 'snprintf' output may be truncated before the last format character [-Werror=format-truncation=]
       snprintf (buf, sizeof buf, "%s*", dangling_link);
                                  ^~~~~
    tst-glob_symlinks.c:128:3: note: 'snprintf' output between 2 and 4097 bytes into a destination of size 4096
       snprintf (buf, sizeof buf, "%s*", dangling_link);
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    This patch fixes the test to avoid such truncation warnings by
    increasing the buffer in question by one byte, to ensure it can hold
    any possible result of %s? or %s* formats where %s comes from a buffer
    of size PATH_MAX.
    
    Tested compilation with build-many-glibcs.py for aarch64-linux-gnu.
    
    	* posix/tst-glob_symlinks.c (do_test): Increase size of buf.

diff --git a/ChangeLog b/ChangeLog
index f90ddb5..a444183 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2017-12-18  Joseph Myers  <joseph@codesourcery.com>
 
+	* posix/tst-glob_symlinks.c (do_test): Increase size of buf.
+
 	* string/tester.c (test_strncat): Also disable -Warray-bounds
 	warnings for two tests.
 
diff --git a/posix/tst-glob_symlinks.c b/posix/tst-glob_symlinks.c
index 5c4b4ec..3a86f4c 100644
--- a/posix/tst-glob_symlinks.c
+++ b/posix/tst-glob_symlinks.c
@@ -94,7 +94,7 @@ do_prepare (int argc, char *argv[])
 static int
 do_test (void)
 {
-  char buf[PATH_MAX];
+  char buf[PATH_MAX + 1];
   glob_t gl;
 
   TEST_VERIFY_EXIT (glob (valid_link, 0, NULL, &gl) == 0);

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                 |    2 ++
 posix/tst-glob_symlinks.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]