From nobody Sun Feb 8 20:53:38 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1614696611; cv=none; d=zohomail.com; s=zohoarc; b=jrSTp6Tw35EdqlPUaQA6QAq9Zcg1WxPOCz2PWK50A4PsXmdsVoppXNBWtSKcGkTPLnoreEI9JxIbsXvH9zSXwLhYSDHHAQyAJyOmpXwIQTawtca1PKyNicVl3bzZQtY2V/0rItVzuQIHjZka9g4xE9kNhPxyKnwnTFFssU7DvQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1614696611; 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=JIQTYJjo+ch9lyNZiG1oZlC2hbeyB5N8LzpgPsQFKk8=; b=Fw4J/3H0sovs+2v6+zQXnOWoH2T5VTqz/5dP9fnNz6G7UPaIGipyN4Jsf/D/bvkCcZ6Ta4i79c9B9hzW282HAv1kPn0nJ+7SQkNDYE/Mps7uhepPe35f1pUpvqFAD3jDF2nPy1+XZlSe/z57UfaOX6ssptul4VF2jId3o5Rlybs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1614696611828687.0906246333245; Tue, 2 Mar 2021 06:50:11 -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-365-IxpXQy0zMPqKng_yKNuuag-1; Tue, 02 Mar 2021 09:50:04 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 423D0107ACE6; Tue, 2 Mar 2021 14:49:58 +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 1A6A0189C4; Tue, 2 Mar 2021 14:49:58 +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 D25EF49; Tue, 2 Mar 2021 14:49:57 +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 122EnfDb014421 for ; Tue, 2 Mar 2021 09:49:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id 7029E5D723; Tue, 2 Mar 2021 14:49:41 +0000 (UTC) Received: from speedmetal.lan (unknown [10.40.208.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id D15515D722 for ; Tue, 2 Mar 2021 14:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614696610; 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=JIQTYJjo+ch9lyNZiG1oZlC2hbeyB5N8LzpgPsQFKk8=; b=Fdo62iIYUtOVGXHgSe7QTnhFLmcOVbkbBTW5G7G2239oddX8UBk1pVisDhuLpJiE97f3AG O8Sndq1meVTAdm7sPSe/AkXZcMJ7FxpPCVZktifJejrejYR4Bq1eyvsExADt9IG2018VXp cRdKP1tbahmQz0PDuuEbB/xT5BC8UVI= X-MC-Unique: IxpXQy0zMPqKng_yKNuuag-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 03/16] sanlock: Use virStrcpy instead of virStrncpy Date: Tue, 2 Mar 2021 15:49:20 +0100 Message-Id: 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.11 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" We want a (possibly truncated) copy of the full source string so virStrcpy is a better fit. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/locking/lock_driver_sanlock.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/locking/lock_driver_sanlock.c b/src/locking/lock_driver_sa= nlock.c index aaffe30e6f..1d8f109375 100644 --- a/src/locking/lock_driver_sanlock.c +++ b/src/locking/lock_driver_sanlock.c @@ -924,9 +924,7 @@ static int virLockManagerSanlockAcquire(virLockManagerP= tr lock, /* sanlock doesn't use owner_name for anything, so it's safe to take j= ust * the first SANLK_NAME_LEN - 1 characters from vm_name */ - ignore_value(virStrncpy(opt->owner_name, priv->vm_name, - MIN(strlen(priv->vm_name), SANLK_NAME_LEN - 1), - SANLK_NAME_LEN)); + virStrcpy(opt->owner_name, priv->vm_name, SANLK_NAME_LEN); if (state && STRNEQ(state, "")) { if ((rv =3D sanlock_state_to_args((char *)state, --=20 2.29.2