From patchwork Thu Oct 4 11:10:01 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jim Meyering X-Patchwork-Id: 189263 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 088502C03AA for ; Fri, 5 Oct 2012 05:43:27 +1000 (EST) Received: from localhost ([::1]:49746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJpe3-0006Jj-F1 for incoming@patchwork.ozlabs.org; Thu, 04 Oct 2012 13:55:35 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59572) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJjLA-0002Pm-JA for qemu-devel@nongnu.org; Thu, 04 Oct 2012 07:11:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TJjL9-0003TD-Lu for qemu-devel@nongnu.org; Thu, 04 Oct 2012 07:11:40 -0400 Received: from mx.meyering.net ([88.168.87.75]:57046 helo=hx.meyering.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TJjL9-0003T5-9H for qemu-devel@nongnu.org; Thu, 04 Oct 2012 07:11:39 -0400 Received: from hx.meyering.net (hx.meyering.net [127.0.0.1]) by hx.meyering.net (8.14.5/8.14.5) with ESMTP id q94BBcl9015829; Thu, 4 Oct 2012 13:11:38 +0200 Received: (from meyering@localhost) by hx.meyering.net (8.14.5/8.14.5/Submit) id q94BBbGi015828; Thu, 4 Oct 2012 13:11:37 +0200 From: Jim Meyering To: qemu-devel@nongnu.org Date: Thu, 4 Oct 2012 13:10:01 +0200 Message-Id: <1349349003-15672-19-git-send-email-jim@meyering.net> X-Mailer: git-send-email 1.8.0.rc0.18.gf84667d In-Reply-To: <1349349003-15672-1-git-send-email-jim@meyering.net> References: <1349349003-15672-1-git-send-email-jim@meyering.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 88.168.87.75 X-Mailman-Approved-At: Thu, 04 Oct 2012 13:54:20 -0400 Cc: Jim Meyering Subject: [Qemu-devel] [PATCHv3 18/20] qcow2: mark this file's sole strncpy use as justified X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Jim Meyering Acked-by: Kevin Wolf Signed-off-by: Jim Meyering --- 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));