Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Dec 2012 20:31:12 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244745 - head/lib/libutil
Message-ID:  <201212272031.qBRKVCh7051717@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Thu Dec 27 20:31:12 2012
New Revision: 244745
URL: http://svnweb.freebsd.org/changeset/base/244745

Log:
  cast to uintptr_t to properly calculate offset
  
  Reported by:	mdf
  Submitted by:	db

Modified:
  head/lib/libutil/gr_util.c

Modified: head/lib/libutil/gr_util.c
==============================================================================
--- head/lib/libutil/gr_util.c	Thu Dec 27 20:24:44 2012	(r244744)
+++ head/lib/libutil/gr_util.c	Thu Dec 27 20:31:12 2012	(r244745)
@@ -452,7 +452,7 @@ gr_dup(const struct group *gr)
 		return (NULL);
 	/* point new gr_mem to end of struct + 1 */
 	if (gr->gr_mem != NULL)
-		newgr->gr_mem = (char **)newgr + sizeof(struct group);
+		newgr->gr_mem = (char **)((uintptr_t)newgr + sizeof(struct group));
 	else
 		newgr->gr_mem = NULL;
 	/* point dst after the end of all the gr_mem pointers in newgr */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212272031.qBRKVCh7051717>