projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3cda346
)
qcow2: mark this file's sole strncpy use as justified
author
Jim Meyering
<meyering@redhat.com>
Thu, 4 Oct 2012 11:10:01 +0000
(13:10 +0200)
committer
Anthony Liguori
<aliguori@us.ibm.com>
Fri, 5 Oct 2012 12:58:38 +0000
(07:58 -0500)
Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
block/qcow2.c
patch
|
blob
|
history
diff --git
a/block/qcow2.c
b/block/qcow2.c
index aa5e603cd31bc97f7838814d74992c9e1599bf7c..c1ff31f4827c61067ab1a51454bc76339649994b 100644
(file)
--- 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));