public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Andreas K. Huttel <dilfridge@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/release/2.38/master] stdlib: Improve tst-realpath compatibility with source fortification Date: Sun, 6 Aug 2023 16:14:59 +0000 (GMT) [thread overview] Message-ID: <20230806161459.509703858D1E@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d97cca1e5df812be0e4de1e38091f02bb1e7ec4e commit d97cca1e5df812be0e4de1e38091f02bb1e7ec4e Author: Florian Weimer <fweimer@redhat.com> Date: Tue Aug 1 10:27:15 2023 +0200 stdlib: Improve tst-realpath compatibility with source fortification On GCC before 11, IPA can make the fortified realpath aware that the buffer size is not large enough (8 bytes instead of PATH_MAX bytes). Fix this by using a buffer that is large enough. (cherry picked from commit 510fc20d73de12c85823d9996faac74666e9c2e7) Diff: --- stdlib/tst-realpath.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stdlib/tst-realpath.c b/stdlib/tst-realpath.c index f325c95a44..3694ecd8af 100644 --- a/stdlib/tst-realpath.c +++ b/stdlib/tst-realpath.c @@ -24,6 +24,7 @@ License along with the GNU C Library; if not, see <https://www.gnu.org/licenses/>. */ +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <malloc.h> @@ -50,7 +51,11 @@ void dealloc (void *p) char* alloc (void) { - return (char *)malloc (8); +#ifdef PATH_MAX + return (char *)malloc (PATH_MAX); +#else + return (char *)malloc (4096); +#endif } static int
reply other threads:[~2023-08-06 16:14 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20230806161459.509703858D1E@sourceware.org \ --to=dilfridge@sourceware.org \ --cc=glibc-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).