From patchwork Thu Mar 1 22:11:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 26145 Received: (qmail 30094 invoked by alias); 1 Mar 2018 22:11:08 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 29684 invoked by uid 89); 1 Mar 2018 22:11:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=*db X-HELO: mx1.redhat.com Date: Thu, 01 Mar 2018 17:11:02 -0500 Message-Id: From: DJ Delorie To: libc-alpha@sourceware.org Subject: [bz 22342] patch: fix netgroup cache keys 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;