From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) by dpdk.org (Postfix) with ESMTP id 9EA8E8E59 for ; Tue, 17 Apr 2018 13:16:35 +0200 (CEST) Received: by mail-it0-f52.google.com with SMTP id m134-v6so15368065itb.3 for ; Tue, 17 Apr 2018 04:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nOgSaD04oxlNFCREJfCfG3CIWgB93NmgxXNHY79WdDQ=; b=RoZfRsqlqcdM/uRpeQjOLuQTC9gncvSzcYEAzCajJCauLuT+95lyAySu8hefkcZ9nY n6joYgtew3+zO8zvd3A2Ikw6vInwQIPgPr4JsN0H2sc8YlDMTeRXDapRfZj5bZgNQI2D HPv0LbAaR06ryC1plRh/sMdUjDteAiILKH2AAM68dW7/HJtOPXkisAxAwnQKwEm13ml0 pAV2gjWT84h6FLTGTh1DW2gf+JAPaI6AOUM5hDtunS6cteQPyLC/MCPKBrRoaWGYd768 v3LwnheKirXITWbAMiuhQ7xYDMylwYUz9sKIqv+Fdq3EJ1wfHKYEBVzRuB2O+Y9U462E z5Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nOgSaD04oxlNFCREJfCfG3CIWgB93NmgxXNHY79WdDQ=; b=RmTb/cE3z2Ou/nmVNNoOMdIOP8AzMUuCjjU3Kcxse4YwMEqB32uxv1rsBFxR4V+jj4 oalvWKwIFyk8buPK1jmJu7Yn39FSFDl9Ad3TEMwaeciBTCg8g48ObgN3Xx+acRbPH7L1 HJ96qo2HYpy6UucBtAa4axa0TXQ1zK0MCsM2kMS647uq80c/NivQL4J7DNN588D4Ov// CTNcH4hR1E8mcPXLiATWBdosd/QJKOmxChp9X37NBp0LPgMj7bHtYx6JsC+GDHyrbp79 d1cGKNdyXDkEZUpDrp7uSsOrXiIa57lMYJMpEPlkI9veKKrRC7ng0kklCUbD84UtQhby Jxog== X-Gm-Message-State: ALQs6tApjkXZEK0Cg6LClBtawrjsOy1IONZ6zB2VbeJY8aT5HrIC8ocI J32rpXIPSnad/f/UjQKvfwplgm3bN2k4CNrZw/0= X-Google-Smtp-Source: AIpwx4/3+HD0HPP5xBQ6xilWo8LjjtCDp6rDWMXCHn1Cd+dyFZjiDn4ACrcXC9BMqGwfJux6eIgaTLyhMtTwoFruDtY= X-Received: by 2002:a24:5143:: with SMTP id s64-v6mr720965ita.116.1523963795003; Tue, 17 Apr 2018 04:16:35 -0700 (PDT) MIME-Version: 1.0 References: <6821483b-30f3-ac79-208c-406fb46685af@intel.com> <1523959561-17400-1-git-send-email-zhouyates@gmail.com> <1581620.t7eghVUmVK@xps> In-Reply-To: From: zhouyangchao Date: Tue, 17 Apr 2018 11:16:24 +0000 Message-ID: To: Thomas Monjalon Cc: "Burakov, Anatoly" , dev@dpdk.org, bruce.richardson@intel.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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:16:35 -0000 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. > > -- > Thanks, > Anatoly >