[patch] NSS test harness upgrade

Stefan Liebler stli@linux.vnet.ibm.com
Thu Jul 20 07:03:00 GMT 2017


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



More information about the Libc-alpha mailing list