glibc/nis/nss_nisplus
Maciej W. Rozycki 780684eb04 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 ac05397075:

commit ac05397075
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.
2018-06-27 21:12:16 +01:00
..
nisplus-alias.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-ethers.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-grp.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-hosts.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-initgroups.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-netgrp.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-network.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-parser.c nisplus: Correct pwent parsing issue and resulting build error [BZ #23266] 2018-06-27 21:12:16 +01:00
nisplus-proto.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-publickey.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-pwd.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-rpc.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-service.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00
nisplus-spwd.c Update copyright dates with scripts/update-copyrights. 2018-01-01 00:32:25 +00:00