summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Meyering2012-10-04 13:10:01 +0200
committerAnthony Liguori2012-10-05 14:58:38 +0200
commit00ea188125f6ee33e6beaff5da878fa9478e6a0d (patch)
tree334a3599252f7dbd2a27a64438a3cacb0a4592da
parentacpi: remove strzcpy (strncpy-identical) function; just use strncpy (diff)
downloadqemu-00ea188125f6ee33e6beaff5da878fa9478e6a0d.tar.gz
qemu-00ea188125f6ee33e6beaff5da878fa9478e6a0d.tar.xz
qemu-00ea188125f6ee33e6beaff5da878fa9478e6a0d.zip
qcow2: mark this file's sole strncpy use as justified
Acked-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r--block/qcow2.c1
1 files changed, 1 insertions, 0 deletions
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));