From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 520D142C04; Thu, 1 Jun 2023 17:02:31 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3ADBF42D5D; Thu, 1 Jun 2023 17:01:24 +0200 (CEST) Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by mails.dpdk.org (Postfix) with ESMTP id 8C36C42D59 for ; Thu, 1 Jun 2023 17:01:22 +0200 (CEST) Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1b024e29657so4262505ad.3 for ; Thu, 01 Jun 2023 08:01:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1685631681; x=1688223681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m33lEkmqGKnD19bn6xGeZcBa1oG7YjatxdgS7K8uixQ=; b=hjL2x0pAyu/qUZZXNVAx4ercALTjWC7XqcplhjRJTvZGafjxyqUt+afJgTamlrBQ/J E1j04Moo7p2HIiU+xdO5PHxh1p8KUH2WJGvpRWjIiEfteFQLhDimGHrPkWopZ0pFQikR mAxKFrX2ju+2nXEAGuuVMHwOOJtjHPqjpEubkBSreH0eD7uUvRBUge/LYYfs2VcqlOwc MIyxb5+54PpkgScrQW6opjsAX9ikztgdQR2cPSsaCLN7iEJ7gTYAeNluMX5EwDjn4F20 Qlrm5CMKsiJ+3nGSIXQNngdMq9NNdJOvpJOJ8G76SitiWUNW3YORcSI1ykflLPB8445N 11cA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685631681; x=1688223681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m33lEkmqGKnD19bn6xGeZcBa1oG7YjatxdgS7K8uixQ=; b=Quc+V/Gy2Njb0DwXQVRcGN4enhFWhuObZ5lGcmrR0s2PVjRJeEbhEAjiLI0hW4Df9S B+bF3Xv1KaosUUSgo79E1CXjgT5RwJlAV/+IAWYqaTMQp8n2bBRVgxR8NHufwk0boDFq ssYpeAHw0xQtjjoBIF9TO6gCXDoQph0wV9byCkKzkTUJwrpq7vR/UwezSMMXiZyyJOse L9d95lw4fCUmmiSpTv8neP5R32n1Qp2i2pYK4qv0vy5zKi1QJSIDC+5Is7gNlHCrogGH 2p68WWFBeF4x0fVyCCEVq0qrUWajEUoPlRM80jewgoTa2qt4MVleG9U1ZNSaKqhFj5en RwYA== X-Gm-Message-State: AC+VfDxyZGZbMG11cl3fmgRvoUb28+z6M1MimfFm/Wn0bm1JlX4wsvZq AtJ9j7S05iFZXGI17Wyy1IZ0eCr1yICHwaxmF1WOcA== X-Google-Smtp-Source: ACHHUZ4/JwxZvEQTGPomiRwJDqoX60+TvmOHAvx7SveSWcv1CIXFfpirgEsY532mtOyRszyqM8QE0g== X-Received: by 2002:a17:902:da83:b0:1ab:675:3e31 with SMTP id j3-20020a170902da8300b001ab06753e31mr7024329plx.37.1685631681533; Thu, 01 Jun 2023 08:01:21 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id ij9-20020a170902ab4900b001ac40488620sm3661955plb.92.2023.06.01.08.01.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 08:01:21 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Elena Agostini Subject: [PATCH 07/25] drivers/gpu: replace snprintf with strlcpy Date: Thu, 1 Jun 2023 08:00:48 -0700 Message-Id: <20230601150106.18375-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230601150106.18375-1-stephen@networkplumber.org> References: <20230601150106.18375-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Suggested by devtools/cocci/strlcpy-with-header.cocci Signed-off-by: Stephen Hemminger --- drivers/gpu/cuda/cuda.c | 2 +- drivers/gpu/cuda/gdrcopy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/cuda/cuda.c b/drivers/gpu/cuda/cuda.c index a552aabeb82d..01875816d592 100644 --- a/drivers/gpu/cuda/cuda.c +++ b/drivers/gpu/cuda/cuda.c @@ -291,7 +291,7 @@ cuda_loader(void) char cuda_path[1024]; if (getenv("CUDA_PATH_L") == NULL) - snprintf(cuda_path, 1024, "%s", "libcuda.so"); + strlcpy(cuda_path, "libcuda.so", 1024); else snprintf(cuda_path, 1024, "%s/%s", getenv("CUDA_PATH_L"), "libcuda.so"); diff --git a/drivers/gpu/cuda/gdrcopy.c b/drivers/gpu/cuda/gdrcopy.c index 322a5dbeb207..ad7809a99b00 100644 --- a/drivers/gpu/cuda/gdrcopy.c +++ b/drivers/gpu/cuda/gdrcopy.c @@ -20,7 +20,7 @@ gdrcopy_loader(void) char gdrcopy_path[1024]; if (getenv("GDRCOPY_PATH_L") == NULL) - snprintf(gdrcopy_path, 1024, "%s", "libgdrapi.so"); + strlcpy(gdrcopy_path, "libgdrapi.so", 1024); else snprintf(gdrcopy_path, 1024, "%s/%s", getenv("GDRCOPY_PATH_L"), "libgdrapi.so"); -- 2.39.2