mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
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.
This commit is contained in:
parent
4f329ea996
commit
f8cef4d07d
@ -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]
|
||||
|
@ -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++)
|
||||
|
Loading…
Reference in New Issue
Block a user