This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[bz 22342] patch: fix netgroup cache keys
- From: DJ Delorie <dj at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 01 Mar 2018 17:11:02 -0500
- Subject: [bz 22342] patch: fix netgroup cache keys
- Authentication-results: sourceware.org; auth=none
Functionality tested on RHEL 7. Regression tested on Fedora 26.
[BZ #22342]
* nscd/netgroupcache.c (addinnetgrX): Include trailing NUL in
key value.
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;