[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v2 02/21] xen: guestcopy: Provide an helper to safely copy string from guest



Hi Stefano,

On 08/06/2014 02:56 PM, Stefano Stabellini wrote:
>> diff --git a/xen/common/guestcopy.c b/xen/common/guestcopy.c
>> new file mode 100644
>> index 0000000..c01555c
>> --- /dev/null
>> +++ b/xen/common/guestcopy.c
>> @@ -0,0 +1,29 @@
>> +#include <xen/config.h>
>> +#include <xen/lib.h>
>> +#include <xen/guest_access.h>
>> +
>> +/* The function copies a string from the guest and add a NUL-terminated to
>> + * make sure the string is correctly finished. */
>> +int safe_copy_string_from_guest(XEN_GUEST_HANDLE(char) u_buf, char **buf,
>> +                                unsigned long size, unsigned long max_size)
> 
> Why did you change the size type from size_t to unsigned long?

I don't remember why. I will reuse size_t here.

Regards,


-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.