Skip to content

Commit

Permalink
qcow2: mark this file's sole strncpy use as justified
Browse files Browse the repository at this point in the history
Acked-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
  • Loading branch information
Jim Meyering authored and Anthony Liguori committed Oct 5, 2012
1 parent 3cda346 commit 00ea188
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions block/qcow2.c
Expand Up @@ -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));
Expand Down

0 comments on commit 00ea188

Please sign in to comment.