From: Jim Meyering Date: Thu, 4 Oct 2012 11:10:02 +0000 (+0200) Subject: hw/r2d: add comment: this strncpy use is ok X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9310b9be14f73d4c1e98bfa315fe84326ad9e8e7;p=qemu.git hw/r2d: add comment: this strncpy use is ok Signed-off-by: Jim Meyering Signed-off-by: Anthony Liguori --- diff --git a/hw/r2d.c b/hw/r2d.c index 0f16e81afe..1bc191ff3e 100644 --- a/hw/r2d.c +++ b/hw/r2d.c @@ -332,6 +332,8 @@ static void r2d_init(ram_addr_t ram_size, } if (kernel_cmdline) { + /* I see no evidence that this .kernel_cmdline buffer requires + NUL-termination, so using strncpy should be ok. */ strncpy(boot_params.kernel_cmdline, kernel_cmdline, sizeof(boot_params.kernel_cmdline)); }