From patchwork Wed Jul 19 17:19:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: DJ Delorie X-Patchwork-Id: 21688 Received: (qmail 24957 invoked by alias); 19 Jul 2017 17:19:58 -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 24922 invoked by uid 89); 19 Jul 2017 17:19:57 -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, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D1C967CE14 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=dj@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D1C967CE14 From: DJ Delorie To: "Carlos O'Donell" Cc: stli@linux.vnet.ibm.com, libc-alpha@sourceware.org Subject: Re: [patch] NSS test harness upgrade In-Reply-To: (carlos@redhat.com) Date: Wed, 19 Jul 2017 13:19:51 -0400 Message-ID: MIME-Version: 1.0 I've checked in this hopefully obvious patch... From f8cef4d07d9641e27629bd3ce2d13f5d702fb251 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Wed, 19 Jul 2017 13:14:34 -0400 Subject: Fix cast-after-dereference Original code was dereferencing a char*, then casting the value to size_t. Should cast the pointer to size_t* then deference. diff --git a/ChangeLog b/ChangeLog index d514f08..8618e26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-07-19 DJ Delorie + + * grp/grp-merge.c (libc_hidden_def): Fix cast-after-dereference. + 2017-07-19 H.J. Lu [BZ #21741] diff --git a/grp/grp-merge.c b/grp/grp-merge.c index 6590e5d..035e7a6 100644 --- a/grp/grp-merge.c +++ b/grp/grp-merge.c @@ -137,7 +137,7 @@ __merge_grp (struct group *savedgrp, char *savedbuf, char *savedend, /* Get the count of group members from the last sizeof (size_t) bytes in the mergegrp buffer. */ - savedmemcount = (size_t) *(savedend - sizeof (size_t)); + savedmemcount = *(size_t *) (savedend - sizeof (size_t)); /* Get the count of new members to add. */ for (memcount = 0; mergegrp->gr_mem[memcount]; memcount++)