diff options
author | DJ Delorie <dj@delorie.com> | 2017-07-19 13:14:34 -0400 |
---|---|---|
committer | DJ Delorie <dj@delorie.com> | 2017-07-19 13:17:03 -0400 |
commit | f8cef4d07d9641e27629bd3ce2d13f5d702fb251 (patch) | |
tree | a7d3591b91a319798aa5f1cd476b166ce71b1a36 /grp | |
parent | 4f329ea996af7e3414b1806c86f6d32866d34b36 (diff) | |
download | glibc-f8cef4d07d9641e27629bd3ce2d13f5d702fb251.zip glibc-f8cef4d07d9641e27629bd3ce2d13f5d702fb251.tar.gz glibc-f8cef4d07d9641e27629bd3ce2d13f5d702fb251.tar.bz2 |
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.
Diffstat (limited to 'grp')
-rw-r--r-- | grp/grp-merge.c | 2 |
1 files changed, 1 insertions, 1 deletions
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++) |