[19/22] qcow2: mark this file's sole strncpy use as justified

Submitted by Jim Meyering on May 9, 2012, 9:24 a.m.

Details

Message ID 1336555446-20180-20-git-send-email-jim@meyering.net
State New
Headers show

Commit Message

Jim Meyering May 9, 2012, 9:24 a.m.
From: Jim Meyering <meyering@redhat.com>


Signed-off-by: Jim Meyering <meyering@redhat.com>
---
 block/qcow2.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/block/qcow2.c b/block/qcow2.c
index 8c60a6f..abc985e 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -990,6 +990,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));