From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id D1B578E5B for ; Tue, 17 Apr 2018 13:47:45 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 4ACC521C63; Tue, 17 Apr 2018 07:47:45 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 17 Apr 2018 07:47:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=F72cguJ/qd6HIOuHUxhE18zhQU VQQVnilQPSK1dc0Mc=; b=RbF44tWWXPILTwtjMjVG5uzqKbCZIgA5PK0uooSJxQ fbfrN9IcJuj4rg04ozP74tZMpQC3aKdR7D7tVCqH3fW9KO3gd8UbXyroZk8X9qPS WVjHEq4Sht9DrfRtc9xhK2wnZUyhaw54AywRDe79vE4yR6FR8THVGPDj7ix9BYyI U= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=F72cgu J/qd6HIOuHUxhE18zhQUVQQVnilQPSK1dc0Mc=; b=JdXYETzzT9s6w3Qx07IPxS jIo3lwaPmsCeVQLyqGZOqSLWA1GPdXjg7/Z7U9vgSXYlf+YOMqaGrsDYxxRKnNdj vrVOGPgkHi7QKABBmE9ca9rQXFSLFZs1JvaCDAffnwdTn24H16zpurmTNrjtZof3 bX+9VNKDmN9++Yqy9vc5WIpiZoeOaHIyy5cDjgaawpx9fXXrcuf7FflkCEJ5IRiV uOdr/c5k9CcXRbtQisWllgHG8nyy78yVMlpfaKpzaJGdB/HBXyvwBwiYY/xfJBuF f5TN/X3MpkQjempP/Y1NMpkavpmpKm1XszsYsmJL0WppA3IzHyyZyqySyum30D9g == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 8B191E43E8; Tue, 17 Apr 2018 07:47:44 -0400 (EDT) From: Thomas Monjalon To: zhouyangchao Cc: dev@dpdk.org, "Burakov, Anatoly" , bruce.richardson@intel.com Date: Tue, 17 Apr 2018 13:47:43 +0200 Message-ID: <1581625.s6OpJcviaZ@xps> In-Reply-To: References: <6821483b-30f3-ac79-208c-406fb46685af@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] mem: memory leaks of hubedir caused by strdup X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Apr 2018 11:47:46 -0000 I see no reason to accept this patch, replacing strdup by snprintf, given that we have strlcpy. Please do a v3 with strlcpy. 17/04/2018 13:16, zhouyangchao: > As Burakov said, for no other reason, I just followed the old version. > > On Tue, Apr 17, 2018 at 6:31 PM Burakov, Anatoly > wrote: > > > On 17-Apr-18 11:24 AM, Thomas Monjalon wrote: > > > 17/04/2018 12:06, Yangchao Zhou: > > >> Coverity issue: 272585 > > >> Fixes: cb97d93e9d3b ("mem: share hugepage info primary and secondary") > > >> > > >> Signed-off-by: Yangchao Zhou > > >> Acked-by: Anatoly Burakov > > > > > > Better to provide a small explanation. > > > > > >> - retval = strdup(splitstr[MOUNTPT]); > > >> + snprintf(hugedir, len, "%s", > > splitstr[MOUNTPT]); > > > > > > I think it is candidate to be replaced by strlcpy. > > > Please check > > > > > > > Yes, it seems that strlcpy thingie was merged without much fanfare. I'll > > be submitting a patch fixing various usages of snprintf in my recent > > commits. I'm inclined to leave this as is for this commit, as it's not > > the purpose of this fix.