This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [patch] NSS test harness upgrade
- From: DJ Delorie <dj at redhat dot com>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: stli at linux dot vnet dot ibm dot com, libc-alpha at sourceware dot org
- Date: Wed, 19 Jul 2017 13:19:51 -0400
- Subject: Re: [patch] NSS test harness upgrade
- Authentication-results: sourceware.org; auth=none
- 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 at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D1C967CE14
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D1C967CE14
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++)