4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-27 19:17:18 +08:00

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

44d51c3f06

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
This commit is contained in:
Jon Turney 2023-07-11 15:08:14 +01:00
parent e867f8c3e8
commit 0e8227bbb7
No known key found for this signature in database
GPG Key ID: C7C86F0370285C81

View File

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