glibc/glibc-upstream-2.34-376.patch
Florian Weimer ad85e10075 Sync with upstream branch release/2.34/master
Upstream commit: commit 6484ae5b8c4d4314f748e4d3c9a9baa5385e57c5

- malloc: Fix -Wuse-after-free warning in tst-mallocalign1 [BZ #26779]
- s_sincosf.h: Change pio4 type to float [BZ #28713]
- math: Properly cast X_TLOSS to float [BZ #28713]
- Regenerate ulps on x86_64 with GCC 12
- Avoid -Wuse-after-free in tests [BZ #26779].
- Fix build of nptl/tst-thread_local1.cc with GCC 12
- Fix stdio-common tests for GCC 12 -Waddress
- Fix stdlib/tst-setcontext.c for GCC 12 -Warray-compare
- resolv: Avoid GCC 12 false positive warning [BZ #28439].
- intl: Avoid -Wuse-after-free [BZ #26779]
- elf: Drop elf/tls-macros.h in favor of __thread and tls_model attributes [BZ #28152] [BZ #28205]
- time: Set daylight to 1 for matching DST/offset change (RHBZ#2155352)
- elf/tst-tlsopt-powerpc fails when compiled with -mcpu=power10 (BZ# 29776)
- time: Use 64 bit time on tzfile
- nscd: Use 64 bit time_t on libc nscd routines (BZ# 29402)
- nis: Build libnsl with 64 bit time_t
- Use LFS and 64 bit time for installed programs (BZ #15333)

Resolves: #2155352
Related: #2160734
2023-01-17 09:30:20 +01:00

28 lines
969 B
Diff

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 --git a/resolv/res_query.c b/resolv/res_query.c
index 2f3c28cfc8c0d832..1d2c81737bc889c9 100644
--- a/resolv/res_query.c
+++ b/resolv/res_query.c
@@ -626,7 +626,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,