From nobody Fri Nov 14 02:15:34 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1584539393; cv=none; d=zohomail.com; s=zohoarc; b=CP57iMctnbJYIFnUpkAumjFy0bQxOo6X/Cdy/on27ROm6vvJkVvL1BFVRH59eUyupG+v1uLJi7SI6EeudkjOAAQPwFQBxrg0CMwnmnrxuPTW3GUEa8rVqB2ZtNdgDumFI4Um72lsjNfKo3fWNLw5gnk/1bRwUTz5xfEnrJlm/Yo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1584539393; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=tDXB/8+Q9VTzUqH6QIri9JT1cxyBCk802SIj4HcYUp4=; b=KUgHFyezJDB+wVT84sPbO8CFGTO5GDb7hsZ8LgwEv6UEK4VutkWcGdaDcuOlcxaCcd6GfBlkfChj+rXbHYaJeTa1vCXPwzSVtjP9ifY0qmc8V4RsrIc67uZNeifA9magXoJMeIdlqFZyKC50VsxfmQ+szZ6MzRHLWvqrOMEUIOg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 15845393935291014.8346043259036; Wed, 18 Mar 2020 06:49:53 -0700 (PDT) Received: from localhost ([::1]:50944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEZ4y-0006Ua-1N for importer@patchew.org; Wed, 18 Mar 2020 09:49:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41469) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEZ4I-0005yr-W5 for qemu-devel@nongnu.org; Wed, 18 Mar 2020 09:49:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEZ4H-0002Qv-7D for qemu-devel@nongnu.org; Wed, 18 Mar 2020 09:49:10 -0400 Received: from us-smtp-delivery-74.mimecast.com ([63.128.21.74]:47344) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jEZ4H-0002LH-0L for qemu-devel@nongnu.org; Wed, 18 Mar 2020 09:49:09 -0400 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-46-cPIBvck8NrWIG10ooCm2yg-1; Wed, 18 Mar 2020 09:49:06 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4099C18B5FA0; Wed, 18 Mar 2020 13:49:05 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-116-41.sin2.redhat.com [10.67.116.41]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F40D60BEC; Wed, 18 Mar 2020 13:48:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1584539348; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tDXB/8+Q9VTzUqH6QIri9JT1cxyBCk802SIj4HcYUp4=; b=bWDhe2Z4E2MIww8pv/aR4m7qC5FlvqbS0VhE+tkA5wkjWC7W+GaRtsPqaJ63/L1R/HTUz3 uy+i5cNF3rNSNoqR3Tiq/cajImZ37zbONsFihtzKEA/iWwFfAUsZMoT+Hud1CW2bWCXi4C /eauDL+UDK032r0zhbPBjGc4VQ7jeSE= X-MC-Unique: cPIBvck8NrWIG10ooCm2yg-1 From: Julia Suvorova To: qemu-devel@nongnu.org Subject: [PATCH] hw/rdma/vmw/pvrdma_dev_ring: Replace strncpy with pstrcpy Date: Wed, 18 Mar 2020 14:48:49 +0100 Message-Id: <20200318134849.237011-1-jusual@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 63.128.21.74 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Julia Suvorova , Yuval Shaia Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" ring->name is defined as 'char name[MAX_RING_NAME_SZ]'. Replace untruncated strncpy with QEMU function. This case prevented QEMU from compiling with --enable-sanitizers. Signed-off-by: Julia Suvorova Reviewed-by: Stefan Hajnoczi Reviewed-by: Yuval Shaia --- hw/rdma/vmw/pvrdma_dev_ring.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/rdma/vmw/pvrdma_dev_ring.c b/hw/rdma/vmw/pvrdma_dev_ring.c index d7bc7f5ccc..c2b3dd70a9 100644 --- a/hw/rdma/vmw/pvrdma_dev_ring.c +++ b/hw/rdma/vmw/pvrdma_dev_ring.c @@ -16,6 +16,7 @@ #include "qemu/osdep.h" #include "hw/pci/pci.h" #include "cpu.h" +#include "qemu/cutils.h" =20 #include "trace.h" =20 @@ -30,8 +31,7 @@ int pvrdma_ring_init(PvrdmaRing *ring, const char *name, = PCIDevice *dev, int i; int rc =3D 0; =20 - strncpy(ring->name, name, MAX_RING_NAME_SZ); - ring->name[MAX_RING_NAME_SZ - 1] =3D 0; + pstrcpy(ring->name, MAX_RING_NAME_SZ, name); ring->dev =3D dev; ring->ring_state =3D ring_state; ring->max_elems =3D max_elems; --=20 2.24.1