[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCHv3 18/20] qcow2: mark this file's sole strncpy use as
From: |
Jim Meyering |
Subject: |
[Qemu-devel] [PATCHv3 18/20] qcow2: mark this file's sole strncpy use as justified |
Date: |
Thu, 4 Oct 2012 13:10:01 +0200 |
From: Jim Meyering <address@hidden>
Acked-by: Kevin Wolf <address@hidden>
Signed-off-by: Jim Meyering <address@hidden>
---
block/qcow2.c | 1 +
1 file changed, 1 insertion(+)
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));
--
1.8.0.rc0.18.gf84667d
- [Qemu-devel] [PATCHv3 12/20] bt: replace fragile snprintf use and unwarranted strncpy, (continued)
- [Qemu-devel] [PATCHv3 15/20] qemu-ga: prefer pstrcpy: consistently NUL-terminate ifreq.ifr_name, Jim Meyering, 2012/10/04
- [Qemu-devel] [PATCHv3 16/20] libcacard/vcard_emul_nss: use pstrcpy in place of strncpy, Jim Meyering, 2012/10/04
- [Qemu-devel] [PATCHv3 13/20] virtio-9p: avoid unwarranted uses of strncpy, Jim Meyering, 2012/10/04
- [Qemu-devel] [PATCHv3 14/20] vscsi: avoid unwarranted strncpy, Jim Meyering, 2012/10/04
- [Qemu-devel] [PATCHv3 20/20] doc: update HACKING wrt strncpy/pstrcpy, Jim Meyering, 2012/10/04
- [Qemu-devel] [PATCHv3 18/20] qcow2: mark this file's sole strncpy use as justified,
Jim Meyering <=
- [Qemu-devel] [PATCHv3 19/20] hw/r2d: add comment: this strncpy use is ok, Jim Meyering, 2012/10/04
- [Qemu-devel] [PATCHv3 17/20] acpi: remove strzcpy (strncpy-identical) function; just use strncpy, Jim Meyering, 2012/10/04