- Remove unnecessary packed attributes.
- Access a packed structure directly rather than via a separate pointer.
struct wim_inode *back_inode;
u32 back_stream_id;
};
struct wim_inode *back_inode;
u32 back_stream_id;
};
- } _packed_attribute; /* union is SHA1_HASH_SIZE bytes */
/* Number of times this blob is referenced by file streams in WIM
* images. See blob_decrement_refcnt() for information about the
/* Number of times this blob is referenced by file streams in WIM
* images. See blob_decrement_refcnt() for information about the
union {
u8 _stream_hash[SHA1_HASH_SIZE];
struct blob_descriptor *_stream_blob;
union {
u8 _stream_hash[SHA1_HASH_SIZE];
struct blob_descriptor *_stream_blob;
- } _packed_attribute; /* union is SHA1_HASH_SIZE bytes */
/* 'stream_resolved' determines whether 'stream_hash' or 'stream_blob'
* is valid as described above. */
/* 'stream_resolved' determines whether 'stream_hash' or 'stream_blob'
* is valid as described above. */
unsigned num_offsets;
size_t extra_size;
unsigned increment;
unsigned num_offsets;
size_t extra_size;
unsigned increment;
enum hive_status status;
if (stats->levels_remaining == 0 || stats->subkey_lists_remaining == 0)
enum hive_status status;
if (stats->levels_remaining == 0 || stats->subkey_lists_remaining == 0)
sizeof(struct subkey_list) + extra_size))
return HIVE_CORRUPT;
sizeof(struct subkey_list) + extra_size))
return HIVE_CORRUPT;
switch (list->base.magic) {
case LF_MAGIC:
case LH_MAGIC:
switch (list->base.magic) {
case LF_MAGIC:
case LH_MAGIC:
while (num_offsets--) {
const struct nk *sub_nk;
while (num_offsets--) {
const struct nk *sub_nk;
- sub_nk = get_cell_pointer(regf, *p, sizeof(struct nk));
+ sub_nk = get_cell_pointer(regf, list->elements[i],
+ sizeof(struct nk));
if (!sub_nk || sub_nk->base.magic != NK_MAGIC)
return HIVE_CORRUPT;
if (!sub_nk || sub_nk->base.magic != NK_MAGIC)
return HIVE_CORRUPT;
- if (!revalidate_cell(regf, *p, sizeof(struct nk) +
+ if (!revalidate_cell(regf, list->elements[i],
+ sizeof(struct nk) +
le16_to_cpu(sub_nk->name_size)))
return HIVE_CORRUPT;
status = (*cb)(sub_nk, cb_ctx);
if (status != HIVE_OK)
return status;
le16_to_cpu(sub_nk->name_size)))
return HIVE_CORRUPT;
status = (*cb)(sub_nk, cb_ctx);
if (status != HIVE_OK)
return status;
}
return HIVE_OK;
case RI_MAGIC:
}
return HIVE_OK;
case RI_MAGIC:
status = HIVE_OK;
stats->levels_remaining--;
while (num_offsets--) {
status = HIVE_OK;
stats->levels_remaining--;
while (num_offsets--) {
- status = iterate_subkeys_recursive(regf, *p++,
- cb, cb_ctx, stats);
+ status = iterate_subkeys_recursive(regf,
+ list->elements[i++],
+ cb, cb_ctx, stats);
if (status != HIVE_OK)
break;
}
if (status != HIVE_OK)
break;
}