From nobody Sun Feb 8 20:12:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1614696681; cv=none; d=zohomail.com; s=zohoarc; b=cCgeo3qYmSam7qxaiA5vDNUXG+79hPkYN3qyaTlwsLJYCiakbAFlkqvdCbJl82L9iikYtUeouwtoYvN8OfzqxZOHfJkCLjTHior9ow481xDbj8cbb4jlsK1pd5o/XIDYrgso4/y3Ew44dwVrEPfUDAHVbNZWiAG4rsdRqnaIZKU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614696681; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fdEdJfaajFI9o7uGv0PkZIkY0vmUiCyryPZIvu14XvU=; b=DwDffWdcAzG2TIMb8VZMD8h8xewKryZx/05TZA3lAsLbDKO0i/nIuMJNQsE+ypT/GAdmgz6Blex34Xz1CZt3sZopfp33QoY1kWpQFceFESSyhHgC5k3BMSkr/9alLZj+y26njlGp/YNMo2seEgZw+Y7cEkeRyxDvLgiTlUf4Et0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1614696681955270.5910460794788; Tue, 2 Mar 2021 06:51:21 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-124-q9MUiERUNQquzblSIQAugA-1; Tue, 02 Mar 2021 09:50:10 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AB68380198B; Tue, 2 Mar 2021 14:50:01 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3FB296EF54; Tue, 2 Mar 2021 14:50:01 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F41A158078; Tue, 2 Mar 2021 14:50:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 122EnhNZ014441 for ; Tue, 2 Mar 2021 09:49:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 9706C5D722; Tue, 2 Mar 2021 14:49:43 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id EE3E05B69C for ; Tue, 2 Mar 2021 14:49:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614696680; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fdEdJfaajFI9o7uGv0PkZIkY0vmUiCyryPZIvu14XvU=; b=Leg52FSKIG1Gc6X5t/sXNEc6BmX6nGYR728WqDVim32TVYXpmaEQdnjQyWaeLGcKF2lzN4 yCuxzqkpvgWq5g67K7HPn+NG1pARcDegXwIN1/gb1UB3rddNu7DIz4w4G4t7omA9mMgt4A 7Itpz+svo3wQ+I/6e6t5bgEf2uHAd2E= X-MC-Unique: q9MUiERUNQquzblSIQAugA-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 05/16] virFileLoopDeviceAssociate: Use virStrcpy instead of virStrncpy Date: Tue, 2 Mar 2021 15:49:22 +0100 Message-Id: <0203996e2f3ffbe650717ab2712e2bbb19957355.1614696480.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Passing 'strlen(src)' for length makes it equivalent to virStrcpy. Signed-off-by: Peter Krempa --- src/util/virfile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 841a0f4e00..29445fc0ff 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -810,8 +810,7 @@ int virFileLoopDeviceAssociate(const char *file, lo.lo_flags =3D LO_FLAGS_AUTOCLEAR; /* Set backing file name for LOOP_GET_STATUS64 queries */ - if (virStrncpy((char *) lo.lo_file_name, file, - strlen(file), LO_NAME_SIZE) < 0) { + if (virStrcpy((char *) lo.lo_file_name, file, LO_NAME_SIZE) < 0) { virReportSystemError(errno, _("Unable to set backing file %s"), file); goto cleanup; --=20 2.29.2