diff --git a/ChangeLog b/ChangeLog index e7f672a8e2..baff9fa479 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2018-03-01 DJ Delorie + + [BZ #22342] + * nscd/netgroupcache.c (addinnetgrX): Include trailing NUL in + key value. + 2018-02-26 Dmitry V. Levin [BZ #22433] diff --git a/NEWS b/NEWS index d6da060f8b..ad425f2c37 100644 --- a/NEWS +++ b/NEWS @@ -11,6 +11,7 @@ The following bugs are resolved with this release: [6889] 'PWD' mentioned but not specified [16335] Feature test macro documentation incomplete and out of date + [22342] NSCD not properly caching netgroup [22638] sparc: static binaries are broken if glibc is built by gcc configured with --enable-default-pie [22735] Misleading typo in time.h source comment regarding CLOCKS_PER_SECOND diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c index b832c9315f..2f187b208c 100644 --- a/nscd/netgroupcache.c +++ b/nscd/netgroupcache.c @@ -480,7 +480,7 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req, { const char *group = key; key = (char *) rawmemchr (key, '\0') + 1; - size_t group_len = key - group - 1; + size_t group_len = key - group; const char *host = *key++ ? key : NULL; if (host != NULL) key = (char *) rawmemchr (key, '\0') + 1;