diff options
author | Mike Frysinger | 2006-03-08 07:03:27 +0000 |
---|---|---|
committer | Mike Frysinger | 2006-03-08 07:03:27 +0000 |
commit | 874af85d5eb08b65476f406f6a1e7edc127ac210 (patch) | |
tree | 1cb4ee52f1592350dd9c4471b2a334957cc42b5e /e2fsprogs/ext2fs/ext2fs_inline.c | |
parent | 0f2dd9f4eb9007bf44aa3f0cf30a35c36fbbd5b2 (diff) | |
download | busybox-874af85d5eb08b65476f406f6a1e7edc127ac210.zip busybox-874af85d5eb08b65476f406f6a1e7edc127ac210.tar.gz |
import most of e2fsprogs 1.38 updates
Diffstat (limited to 'e2fsprogs/ext2fs/ext2fs_inline.c')
-rw-r--r-- | e2fsprogs/ext2fs/ext2fs_inline.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/e2fsprogs/ext2fs/ext2fs_inline.c b/e2fsprogs/ext2fs/ext2fs_inline.c index 73d393d..a363b19 100644 --- a/e2fsprogs/ext2fs/ext2fs_inline.c +++ b/e2fsprogs/ext2fs/ext2fs_inline.c @@ -44,12 +44,14 @@ errcode_t ext2fs_resize_mem(unsigned long EXT2FS_ATTR((unused)) old_size, unsigned long size, void *ptr) { void *p; - void **pp = (void **)ptr; - p = realloc(*pp, size); + /* Use "memcpy" for pointer assignments here to avoid problems + * with C99 strict type aliasing rules. */ + memcpy(&p, ptr, sizeof (p)); + p = realloc(p, size); if (!p) return EXT2_ET_NO_MEMORY; - *pp = p; + memcpy(ptr, &p, sizeof (p)); return 0; } |