diff options
author | Jim Meyering <meyering@redhat.com> | 2012-10-04 13:10:01 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-10-05 07:58:38 -0500 |
commit | 00ea188125f6ee33e6beaff5da878fa9478e6a0d (patch) | |
tree | 334a3599252f7dbd2a27a64438a3cacb0a4592da | |
parent | 3cda346269784c234c7a296ff6851f36a1a9189d (diff) | |
download | qemu-00ea188125f6ee33e6beaff5da878fa9478e6a0d.zip qemu-00ea188125f6ee33e6beaff5da878fa9478e6a0d.tar.gz qemu-00ea188125f6ee33e6beaff5da878fa9478e6a0d.tar.bz2 |
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.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index aa5e603..c1ff31f 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)); |