2018-03-01 DJ Delorie [BZ #22342] * nscd/netgroupcache.c (addinnetgrX): Include trailing NUL in key value. Index: glibc-2.27/nscd/netgroupcache.c =================================================================== --- glibc-2.27.orig/nscd/netgroupcache.c +++ glibc-2.27/nscd/netgroupcache.c @@ -480,7 +480,7 @@ addinnetgrX (struct database_dyn *db, in { 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;