[Bug nis/23266] stringop-truncation warning with new gcc8.1 in nisplus-parser.c
cvs-commit at gcc dot gnu.org
sourceware-bugzilla@sourceware.org
Wed Jun 27 20:14:00 GMT 2018
https://sourceware.org/bugzilla/show_bug.cgi?id=23266
--- Comment #3 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 780684eb04298977bc411ebca1eadeeba4877833 (commit)
from c49e18222e4c40f21586dabced8a49732d946917 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=780684eb04298977bc411ebca1eadeeba4877833
commit 780684eb04298977bc411ebca1eadeeba4877833
Author: Maciej W. Rozycki <macro@mips.com>
Date: Wed Jun 27 21:12:16 2018 +0100
nisplus: Correct pwent parsing issue and resulting build error [BZ #23266]
Copy and null-terminate NIS+ password file UID and GID entries whose
length is non-zero and are not terminated, in addition to empty ones,
fixing a bug and a compilation issue causing an error with GCC 8:
nss_nisplus/nisplus-parser.c: In function '_nss_nisplus_parse_pwent':
nss_nisplus/nisplus-parser.c:90:7: error: 'strncpy' destination unchanged
after copying no bytes [-Werror=stringop-truncation]
strncpy (first_unused, numstr, len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
nss_nisplus/nisplus-parser.c:106:7: error: 'strncpy' destination unchanged
after copying no bytes [-Werror=stringop-truncation]
strncpy (first_unused, numstr, len);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
introduced with commit ac05397075f6:
commit ac05397075f621cfdbe1db527c96167a58b6d18e
Author: Ulrich Drepper <drepper@redhat.com>
Date: Sun Apr 30 07:01:26 2006 +0000
* nis/nss_nisplus/nisplus-parser.c: Minor optimizations and
cleanups. Avoid copying data if it can be used in the old place.
(no mailing list reference available). Obviously regardless of the
recently added compiler diagnostics causing a build error this code has
been long non-functional, so I guess NIS+ servers have been supplying
strings that are non-empty and have already been null-terminated.
Which in turn made it unnecessary to make a null-terminated copy,
masking this bug.
[BZ #23266]
* nis/nss_nisplus/nisplus-parser.c (_nss_nisplus_parse_pwent):
Copy and null-terminate entries that are not terminated, in
addition to empty ones.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
nis/nss_nisplus/nisplus-parser.c | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list