public inbox for glibc-cvs@sourceware.org help / color / mirror / Atom feed
From: Florian Weimer <fw@sourceware.org> To: glibc-cvs@sourceware.org Subject: [glibc/release/2.34/master] resolv: Avoid GCC 12 false positive warning [BZ #28439]. Date: Thu, 12 Jan 2023 06:21:21 +0000 (GMT) [thread overview] Message-ID: <20230112062121.6913E385B518@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=92d5c52aaac0fa8e58b92e96bf2025d6848a2845 commit 92d5c52aaac0fa8e58b92e96bf2025d6848a2845 Author: Martin Sebor <msebor@redhat.com> Date: Mon Oct 11 09:36:57 2021 -0600 resolv: Avoid GCC 12 false positive warning [BZ #28439]. Replace a call to sprintf with an equivalent pair of stpcpy/strcpy calls to avoid a GCC 12 -Wformat-overflow false positive due to recent optimizer improvements. (cherry picked from commit eb73b87897798de981dbbf019aa957045d768adb) Diff: --- resolv/res_query.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resolv/res_query.c b/resolv/res_query.c index 75b0e5f2f7..5d0a68dc81 100644 --- a/resolv/res_query.c +++ b/resolv/res_query.c @@ -610,7 +610,9 @@ __res_context_querydomain (struct resolv_context *ctx, RES_SET_H_ERRNO(statp, NO_RECOVERY); return (-1); } - sprintf(nbuf, "%s.%s", name, domain); + char *p = __stpcpy (nbuf, name); + *p++ = '.'; + strcpy (p, domain); } return __res_context_query (ctx, longname, class, type, answer, anslen, answerp, answerp2, nanswerp2,
reply other threads:[~2023-01-12 6:21 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=20230112062121.6913E385B518@sourceware.org \ --to=fw@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).