From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2201) id DEA663858428; Fri, 14 Jul 2023 15:28:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEA663858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689348513; bh=1LezXxIPAsZR9XVWBfA15o4E/7OE11QiRkfPRCRaEJg=; h=From:To:Subject:Date:From; b=Y79+DO9hLcExq0Y/IdU8FlKSijKUvRML8G/zocLBrtrYT5ioLK3mb+ZXk0aoCwdYp cFyE2A/4xRQoGHvOn6kXSXTezlfMbfjJmDLzBSJ5qmewnzB7Wyj4rDtcHhDOAGAAHq Ogn1jcmBFFzvWGs94ADw3DzQH02bCbyQzfr/zRuM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jon Turney To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: testsuite: Fix a buffer overflow in symlink01 X-Act-Checkin: newlib-cygwin X-Git-Author: Jon Turney X-Git-Refname: refs/heads/master X-Git-Oldrev: e867f8c3e89f4f6a85de3a96ddfd2de8f4bb882f X-Git-Newrev: 0e8227bbb746a1f85b9983aab7cef78a4fd41c9a Message-Id: <20230714152833.DEA663858428@sourceware.org> Date: Fri, 14 Jul 2023 15:28:33 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D0e8227bbb74= 6a1f85b9983aab7cef78a4fd41c9a commit 0e8227bbb746a1f85b9983aab7cef78a4fd41c9a Author: Jon Turney Date: Tue Jul 11 15:08:14 2023 +0100 Cygwin: testsuite: Fix a buffer overflow in symlink01 =20 full_path needs to hold a overlong pathname of length PATH_MAX+1, plus a terminating null. =20 See ltp commit 44d51c3f =20 https://github.com/linux-test-project/ltp/commit/44d51c3f0670961149ba48= 6a678cfc13b37cce2c =20 Signed-off-by: Jon Turney 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 =3D 100; const char *TCID =3D NULL; char *Selectedtests =3D 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 th= e PATH_MAX limit, see creat_path_max() */ extern int Tst_count; extern char *TESTDIR; extern char *strrchr();