From: Jim Meyering Date: Thu, 4 Oct 2012 11:10:01 +0000 (+0200) Subject: qcow2: mark this file's sole strncpy use as justified X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=00ea188125f6ee33e6beaff5da878fa9478e6a0d;p=qmiga%2Fqemu.git qcow2: mark this file's sole strncpy use as justified Acked-by: Kevin Wolf Signed-off-by: Jim Meyering Signed-off-by: Anthony Liguori --- diff --git a/block/qcow2.c b/block/qcow2.c index aa5e603cd3..c1ff31f482 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1096,6 +1096,7 @@ int qcow2_update_header(BlockDriverState *bs) goto fail; } + /* Using strncpy is ok here, since buf is not NUL-terminated. */ strncpy(buf, bs->backing_file, buflen); header->backing_file_offset = cpu_to_be64(buf - ((char*) header));