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

Re: [libvirt] [PATCH] virsh: avoid strncpy



On 05/29/2012 08:54 AM, Michal Privoznik wrote:
> On 29.05.2012 16:36, Eric Blake wrote:
>> strncpy is generally evil - it runs the risk of missing NUL
>> termination, and more often than not wastes time zeroing way
>> more bytes than strictly necessary.  We've avoided this evil
>> in our virStrncpy wrapper, except for places where we forgot
>> to use the wrapper; meanwhile, we have also added an even
>> higher layer wrapper for setting virTypedParameter values.
>>
>> * tools/virsh.c (cmdMemtune, cmdBlkdeviotune): Use modern API.
>> * cfg.mk (exclude_file_name_regexp--sc_prohibit_strncpy): Tighten.
>> ---
>>
>> Noticed this while updating to the latest gnulib.
>>
>>  cfg.mk        |    3 +-
>>  tools/virsh.c |  149 +++++++++++++++++++++++++++++----------------------------
>>  2 files changed, 76 insertions(+), 76 deletions(-)
>>
> 
> ACK

Thanks; pushed.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


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