public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Stefan Liebler <stli@linux.vnet.ibm.com>
To: libc-alpha@sourceware.org
Cc: DJ Delorie <dj@redhat.com>, "Carlos O'Donell" <carlos@redhat.com>
Subject: Re: [patch] NSS test harness upgrade
Date: Thu, 20 Jul 2017 07:03:00 -0000	[thread overview]
Message-ID: <a4189ec7-eacd-e2ae-b803-56ce63690067@linux.vnet.ibm.com> (raw)
In-Reply-To: <xn1spcuyx4.fsf@greed.delorie.com>

On 07/19/2017 07:19 PM, DJ Delorie wrote:
> 
> I've checked in this hopefully obvious patch...
> 
>  From f8cef4d07d9641e27629bd3ce2d13f5d702fb251 Mon Sep 17 00:00:00 2001
> From: DJ Delorie <dj@delorie.com>
> 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  <dj@delorie.com>
> +
> +	* grp/grp-merge.c (libc_hidden_def): Fix cast-after-dereference.
> +
>   2017-07-19  H.J. Lu  <hongjiu.lu@intel.com>
> 
>   	[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++)
> 

I've pulled this patch and rerun the test on the mentioned systems.
The test is now passing.

Thanks.
Stefan

  parent reply	other threads:[~2017-07-20  7:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 20:32 DJ Delorie
2017-05-03 22:15 ` DJ Delorie
2017-05-23 21:25 ` DJ Delorie
2017-07-14  0:39 ` DJ Delorie
2017-07-14 15:15   ` Carlos O'Donell
2017-07-14 21:51     ` DJ Delorie
2017-07-15  1:40       ` Carlos O'Donell
2017-07-17 19:53         ` DJ Delorie
2017-07-19 12:04           ` Stefan Liebler
2017-07-19 14:20             ` Carlos O'Donell
2017-07-19 14:53               ` Stefan Liebler
2017-07-19 17:19               ` DJ Delorie
2017-07-19 19:38                 ` Carlos O'Donell
2017-07-19 19:41                   ` DJ Delorie
2017-07-19 20:33                     ` Carlos O'Donell
2017-07-19 21:28                 ` Andreas Schwab
2017-07-19 23:16                   ` DJ Delorie
2017-07-20  0:50                     ` Paul Pluzhnikov
2017-07-20  0:57                       ` DJ Delorie
2017-07-20  6:33                     ` Andreas Schwab
2017-07-20  7:03                 ` Stefan Liebler [this message]
2017-07-27 23:45   ` Joseph Myers
2017-08-09 21:41     ` DJ Delorie
2017-08-09 22:38       ` Carlos O'Donell
2017-08-17 22:01         ` DJ Delorie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a4189ec7-eacd-e2ae-b803-56ce63690067@linux.vnet.ibm.com \
    --to=stli@linux.vnet.ibm.com \
    --cc=carlos@redhat.com \
    --cc=dj@redhat.com \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).