From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 4A2C6A823 for ; Tue, 17 Apr 2018 12:31:13 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Apr 2018 03:31:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,463,1517904000"; d="scan'208";a="46809762" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.237.220.128]) ([10.237.220.128]) by fmsmga004.fm.intel.com with ESMTP; 17 Apr 2018 03:31:09 -0700 To: Thomas Monjalon , Yangchao Zhou Cc: dev@dpdk.org, bruce.richardson@intel.com References: <6821483b-30f3-ac79-208c-406fb46685af@intel.com> <1523959561-17400-1-git-send-email-zhouyates@gmail.com> <1581620.t7eghVUmVK@xps> From: "Burakov, Anatoly" Message-ID: Date: Tue, 17 Apr 2018 11:31:09 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1581620.t7eghVUmVK@xps> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 10:31:15 -0000 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. -- Thanks, Anatoly