Lines 90-110
errcode_t ext2fs_irel_memarray_create(char *name, ext2_ino_t max_inode,
Link Here
|
90 |
irel->priv_data = ma; |
90 |
irel->priv_data = ma; |
91 |
|
91 |
|
92 |
size = (size_t) (sizeof(ext2_ino_t) * (max_inode+1)); |
92 |
size = (size_t) (sizeof(ext2_ino_t) * (max_inode+1)); |
93 |
retval = ext2fs_get_mem(size, &ma->orig_map); |
93 |
retval = ext2fs_get_array(max_inode+1, sizeof(ext2_ino_t), |
|
|
94 |
&ma->orig_map); |
94 |
if (retval) |
95 |
if (retval) |
95 |
goto errout; |
96 |
goto errout; |
96 |
memset(ma->orig_map, 0, size); |
97 |
memset(ma->orig_map, 0, size); |
97 |
|
98 |
|
98 |
size = (size_t) (sizeof(struct ext2_inode_relocate_entry) * |
99 |
size = (size_t) (sizeof(struct ext2_inode_relocate_entry) * |
99 |
(max_inode+1)); |
100 |
(max_inode+1)); |
100 |
retval = ext2fs_get_mem(size, &ma->entries); |
101 |
retval = ext2fs_get_array((max_inode+1, |
|
|
102 |
sizeof(struct ext2_inode_relocate_entry), &ma->entries); |
101 |
if (retval) |
103 |
if (retval) |
102 |
goto errout; |
104 |
goto errout; |
103 |
memset(ma->entries, 0, size); |
105 |
memset(ma->entries, 0, size); |
104 |
|
106 |
|
105 |
size = (size_t) (sizeof(struct inode_reference_entry) * |
107 |
size = (size_t) (sizeof(struct inode_reference_entry) * |
106 |
(max_inode+1)); |
108 |
(max_inode+1)); |
107 |
retval = ext2fs_get_mem(size, &ma->ref_entries); |
109 |
retval = ext2fs_get_mem(max_inode+1, |
|
|
110 |
sizeof(struct inode_reference_entry), &ma->ref_entries); |
108 |
if (retval) |
111 |
if (retval) |
109 |
goto errout; |
112 |
goto errout; |
110 |
memset(ma->ref_entries, 0, size); |
113 |
memset(ma->ref_entries, 0, size); |
Lines 249-255
static errcode_t ima_add_ref(ext2_irel irel, ext2_ino_t ino,
Link Here
|
249 |
if (ref_ent->refs == 0) { |
252 |
if (ref_ent->refs == 0) { |
250 |
size = (size_t) ((sizeof(struct ext2_inode_reference) * |
253 |
size = (size_t) ((sizeof(struct ext2_inode_reference) * |
251 |
ent->max_refs)); |
254 |
ent->max_refs)); |
252 |
retval = ext2fs_get_mem(size, &ref_ent->refs); |
255 |
retval = ext2fs_get_array(ent->max_refs, |
|
|
256 |
sizeof(struct ext2_inode_reference), &ref_ent->refs); |
253 |
if (retval) |
257 |
if (retval) |
254 |
return retval; |
258 |
return retval; |
255 |
memset(ref_ent->refs, 0, size); |
259 |
memset(ref_ent->refs, 0, size); |