Patchwork [PATCHv3,18/20] qcow2: mark this file's sole strncpy use as justified

login
register
mail settings
Submitter Jim Meyering
Date Oct. 4, 2012, 11:10 a.m.
Message ID <1349349003-15672-19-git-send-email-jim@meyering.net>
Download mbox | patch
Permalink /patch/189263/
State New
Headers show

Comments

Jim Meyering - Oct. 4, 2012, 11:10 a.m.
From: Jim Meyering <meyering@redhat.com>

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

Patch

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));