]> git.cameronkatri.com Git - pw-darwin.git/commitdiff
cast to uintptr_t to properly calculate offset
authorBaptiste Daroussin <bapt@FreeBSD.org>
Thu, 27 Dec 2012 20:31:12 +0000 (20:31 +0000)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Thu, 27 Dec 2012 20:31:12 +0000 (20:31 +0000)
Reported by: mdf
Submitted by: db

libutil/gr_util.c

index 4583257d360f9a053b67f00a54ec10cc003f4497..f4a08c4544d50e520e19f4eef239868d55f6b25a 100644 (file)
@@ -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 */