public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: testsuite: Fix a buffer overflow in symlink01
@ 2023-07-14 15:28 Jon Turney
  0 siblings, 0 replies; only message in thread
From: Jon Turney @ 2023-07-14 15:28 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=0e8227bbb746a1f85b9983aab7cef78a4fd41c9a

commit 0e8227bbb746a1f85b9983aab7cef78a4fd41c9a
Author: Jon Turney <jon.turney@dronecode.org.uk>
Date:   Tue Jul 11 15:08:14 2023 +0100

    Cygwin: testsuite: Fix a buffer overflow in symlink01
    
    full_path needs to hold a overlong pathname of length PATH_MAX+1, plus a
    terminating null.
    
    See ltp commit 44d51c3f
    
    https://github.com/linux-test-project/ltp/commit/44d51c3f0670961149ba486a678cfc13b37cce2c
    
    Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>

Diff:
---
 winsup/testsuite/winsup.api/ltp/symlink01.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/testsuite/winsup.api/ltp/symlink01.c b/winsup/testsuite/winsup.api/ltp/symlink01.c
index 54a24b87f..186a85b4e 100644
--- a/winsup/testsuite/winsup.api/ltp/symlink01.c
+++ b/winsup/testsuite/winsup.api/ltp/symlink01.c
@@ -488,7 +488,7 @@ time_t a_time_value = 100;
 const char  *TCID = NULL;
 char  *Selectedtests = NULL;		/* Name (tcid) of selected test cases */
 char test_msg[BUFMAX];
-char full_path[PATH_MAX+1];
+char full_path[PATH_MAX+1+1]; /* Add one for '\0' and another to exceed the PATH_MAX limit, see creat_path_max() */
 extern int Tst_count;
 extern char *TESTDIR;
 extern char *strrchr();

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

only message in thread, other threads:[~2023-07-14 15:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-14 15:28 [newlib-cygwin] Cygwin: testsuite: Fix a buffer overflow in symlink01 Jon Turney

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