From patchwork Wed Aug 14 09:38:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kunwu Chan X-Patchwork-Id: 13763176 X-Patchwork-Delegate: kuba@kernel.org Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3050115FD01 for ; Wed, 14 Aug 2024 09:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723628367; cv=none; b=Pgo4EW/MBAdkmj5WGSDad5vpMFge5EuwaOkWRLCVlmbiAXephaKRLjWMgZ5bfiX0EFJGdQfyine9wQVtwwXgEvqyTYKe0QXfBc9D89QH+Wloq2XNbtkz2UFw3TXH6l8pCh9y3iFWZ0NjMpj8i5WBxUzJYUVS6LagxynF4rSDuGM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723628367; c=relaxed/simple; bh=IeVoT4yufyi68TEdosJy9nI6F36XVIhz0YvYLr4IBtg=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=P/rsTkKRXy7gEzNj8eLkHOovLfh4ypnGTwK/E3HxlZ9LzY6Zp1IJ2QokApeo1lPLl9sZekgMt95RZ4pYoSyPGKrQquwi3Vj+sLnhMQzxhZoomRqbyyYs5wnfziHT40g/5iMqYL/zUgA0NRdi2G6a8Di0jE9owVnGqyEPMVAxgTY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=v4Y2e37U; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="v4Y2e37U" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1723628362; 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=hoKMraIxGqJRJoyIgsLh26ViCmZSqFx8f5iMTWHsaVA=; b=v4Y2e37UaQtwY6/Q1oaRXC+wnuUESSf5FkHv3sDpYrYhh1/pKZqidItOKmJxgEIhp5EmXn QJQ7lR1nlN6SsjSRX1NvfOo5jAF3cYwOGRQX0EWA/EKBCRRHD4CT06EAba8BT3ziVO2mG7 i0znJzkmjg9Okh/Gc3tvcNm0Cbe/+/8= From: kunwu.chan@linux.dev To: trondmy@kernel.org, anna@kernel.org, chuck.lever@oracle.com, jlayton@kernel.org, neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: linux-nfs@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kunwu Chan Subject: [PATCH] SUNRPC: Fix -Wformat-truncation warning Date: Wed, 14 Aug 2024 17:38:53 +0800 Message-Id: <20240814093853.48657-1-kunwu.chan@linux.dev> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Patchwork-Delegate: kuba@kernel.org From: Kunwu Chan Increase size of the servername array to avoid truncated output warning. net/sunrpc/clnt.c:582:75: error:‘%s’ directive output may be truncated writing up to 107 bytes into a region of size 48 [-Werror=format-truncation=] 582 | snprintf(servername, sizeof(servername), "%s", | ^~ net/sunrpc/clnt.c:582:33: note:‘snprintf’ output between 1 and 108 bytes into a destination of size 48 582 | snprintf(servername, sizeof(servername), "%s", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 583 | sun->sun_path); Signed-off-by: Kunwu Chan --- net/sunrpc/clnt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 09f29a95f2bc..874085f3ed50 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -546,7 +546,7 @@ struct rpc_clnt *rpc_create(struct rpc_create_args *args) .connect_timeout = args->connect_timeout, .reconnect_timeout = args->reconnect_timeout, }; - char servername[48]; + char servername[108]; struct rpc_clnt *clnt; int i;