Explicitly cast byte arrays when used in copy_from_guest
PATCH 1/1 Explicitly cast byte arrays when used in copy_from_guest
Explicitly cast the target array type to an array of 'u8' since the number of bytes copied is calculated from the type of element in the target array times the number of elements (3rd parameter).
Signed-off-by Stefan Berger <[email protected]>
--- xen-unstable.hg/xen/acm/acm_policy.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
xen-unstable.hg/xen/acm/acm_policy.c +4 -3
@@ -44,6 +44,7 @@ static void acm_doms_restore_ssidref(voistatic ssidref_t oldssid_to_newssid (const struct acm_ssid_domain *,const struct acm_sized_buffer *map); +#define BYTE_ARRAY (a) ((u8 *)(a))int acm_set_policy (XEN_GUEST_HANDLE_64 (void ) buf,u32 buf_size)
@@ -710,10 +711,10 @@ acm_change_policy(struct acm_change_poli goto acm_chg_policy_exit; } -if (copy_from_guest (dels.array, +if (copy_from_guest (BYTE_ARRAY (dels.array), chgpolicy->del_array, chgpolicy->delarray_size) || -copy_from_guest (ssidmap.array, +copy_from_guest (BYTE_ARRAY (ssidmap.array), chgpolicy->chg_array, chgpolicy->chgarray_size) || copy_from_guest(binpolicy,
@@ -844,7 +845,7 @@ acm_relabel_domains(struct acm_relabel_dmemset (errors.array,0x0 ,sizeof (uint32_t ) * errors.num_items); } -if (copy_from_guest (relabels.array, +if (copy_from_guest (BYTE_ARRAY (relabels.array), relabel->relabel_map, relabel->relabel_map_size) ) {
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel