Go to file
Stefan Liebler 1e0c8356f5 nis: Fix stringop-truncation warning with -O3 in nis_local_host.
When building with -O3 on s390x/x86_64, I get this stringop-truncation warning
which leads to a build fail:

In function ‘nis_local_host’,
    inlined from ‘nis_local_host’ at nis_local_names.c:147:1:
nis_local_names.c:171:11: error: ‘strncpy’ output may be truncated copying between 0 and 1023 bytes from a string of length 1024 [-Werror=stringop-truncation]
171 |           strncpy (cp, nis_local_directory (), NIS_MAXNAMELEN - len -1);
       |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We can just ignore this warning as the hostname + '.' + directory-name + '\0' always fits
in __nishostname with length of (NIS_MAXNAMELEN + 1) as there is the runtime check above.
Furthermore as we already know the length of the directory-name, we can also just use
memcpy to copy the directory-name inclusive the NUL-termination.

Note: This werror was introduced with commit
32c7acd464
"Replace rawmemchr (s, '\0') with strchr"

Reviewed-by: Wilco Dijkstra  <Wilco.Dijkstra@arm.com>
2023-03-02 14:22:54 +01:00
argp
assert
benchtests
bits [hurd] Add MTU_DISCOVER values 2023-02-15 15:14:06 +01:00
catgets
ChangeLog.old
conform
crypt crypt: Remove invalid end of page test badsalttest 2023-02-28 11:30:55 -03:00
csu
ctype
debug
dirent
dlfcn
elf gmon: improve mcount overflow handling [BZ# 27576] 2023-02-22 21:00:14 -05:00
gmon gmon: fix memory corruption issues [BZ# 30101] 2023-02-22 21:03:30 -05:00
gnulib
grp
gshadow
hesiod
htl
hurd hurd: Fix some broken indentation 2023-03-02 00:32:55 +01:00
iconv iconv: Remove _STRING_ARCH_unaligned usage 2023-02-17 15:56:54 -03:00
iconvdata iconv: Remove _STRING_ARCH_unaligned usage for get/set macros 2023-02-17 15:56:54 -03:00
include string: Remove string_private.h 2023-02-17 15:56:54 -03:00
inet C2x strtol binary constant handling 2023-02-16 23:02:40 +00:00
intl
io
libio stdio: Do not ignore posix_spawn error on popen (BZ #29016) 2023-02-14 15:30:35 -03:00
locale C2x strtol binary constant handling 2023-02-16 23:02:40 +00:00
localedata localedata: de_DE should not use Fräulein 2023-02-27 16:54:22 +01:00
login
mach mach: Use PAGE_SIZE 2023-02-20 00:46:36 +01:00
malloc malloc: remove redundant check of unsorted bin corruption 2023-02-22 16:56:45 -05:00
manual tunables.texi: Change \code{1} to @code{1} 2023-02-23 08:50:19 -08:00
math
mathvec
misc cdefs.h: fix "__clang_major" typo 2023-02-27 08:18:24 -03:00
nis nis: Fix stringop-truncation warning with -O3 in nis_local_host. 2023-03-02 14:22:54 +01:00
nptl
nptl_db
nscd Use uintptr_t instead of performing pointer subtraction with a null pointer 2023-02-17 17:07:44 -03:00
nss Use uintptr_t instead of performing pointer subtraction with a null pointer 2023-02-17 17:07:44 -03:00
po
posix __glob64_time64: Fix typo for stub_warning call (BZ #30146) 2023-02-20 13:44:48 +01:00
pwd
resolv C2x strtol binary constant handling 2023-02-16 23:02:40 +00:00
resource
rt
scripts Use Linux 6.2 in build-many-glibcs.py 2023-02-22 21:37:03 +00:00
setjmp
shadow
signal
socket
soft-fp
stdio-common stdio: Do not ignore posix_spawn error on popen (BZ #29016) 2023-02-14 15:30:35 -03:00
stdlib stdlib: Undo post review change to 16adc58e73 [BZ #27749] 2023-02-20 09:32:43 -03:00
string
sunrpc
support support: use 64-bit time_t (bug 30111) 2023-03-02 13:01:32 +01:00
sysdeps LoongArch: Update libm-test-ulps. 2023-03-02 11:17:15 +08:00
sysvipc
termios
time
timezone
wcsmbs C2x strtol binary constant handling 2023-02-16 23:02:40 +00:00
wctype
.clang-format
.gitattributes
.gitignore
abi-tags
aclocal.m4
config.h.in
config.make.in
configure
configure.ac
CONTRIBUTED-BY
COPYING
COPYING.LIB
extra-lib.mk
gen-locales.mk
INSTALL
libc-abis
libof-iterator.mk
LICENSES
MAINTAINERS
Makeconfig
Makefile
Makefile.help
Makefile.in
Makerules
NEWS hppa: Drop old parisc-specific MADV_* constants 2023-02-25 21:59:24 +00:00
o-iterator.mk
README
Rules
SHARED-FILES
shlib-versions
test-skeleton.c
version.h

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arc*-*-linux-gnu
	arm-*-linux-gnueabi
	csky-*-linux-gnuabiv2
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	ia64-*-linux-gnu
	loongarch64-*-linux-gnu Hardware floating point, LE only.
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	or1k-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	riscv32-*-linux-gnu
	riscv64-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see https://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at https://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see https://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.