From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 486E6D4CE for ; Wed, 9 May 2018 12:04:15 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id y189-v6so8423249wmc.3 for ; Wed, 09 May 2018 03:04:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=xPge/O6jktixIqR1dmfAYMKf7itmwCIKhS9V54hppcg=; b=CP1RtmKsm3GSxP8pLpDZG18tAPNCNpNR4S3jFgts/v4bGUBhSijuVplRwX8aFMDfGz wgH03TPCqaGYe0DxtfhllZ4B9W4O0JSY98y3ESdqN0WYctWqfxVOaNdODyDeu+8ngrLm gTjUzwy6xDUj/TyJs7Yt41EoyYJ1WKU8XS/Q8jQa2sBa5wqSrx8bYUvC7Kwu36h6QOM0 +ffasmnNRUdZHSgaNiJbEp2gnXNjpFlsYiebq9cR/noUjkhFoOsSNkZNe1vO6eQC+elP peRuai9KMxjhfXgNR0kQDH7t0GZEkckumFMagQe0IslP69lfw8kUPR94U4OJtObybhaG xn5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=xPge/O6jktixIqR1dmfAYMKf7itmwCIKhS9V54hppcg=; b=Wigw+UJz23N1Y4k8QNFQbDF3qhuzFtEJ7zvgglaAelbdSoKmil1NvZb2U+H6sdxlkp aZX7p6bVA/mxH6knzWN06LmNY3n2De75olwbzvUahUYFF/SnTPHj40g2su5OA+ZxtGg1 +a5VzMd50LpJJfS0z8Oc2+t7sw9JpduyQhjG4n/yqOhy0LAFdtvQV1IHIWsdjxvHCria wbjvMy9dZbVyepiHXdWx5HPDM/6PZaUMF/wVck6fQ6Tqrjx5ZbOPVKAtkPtpLiT/s+Rl 7GwcSb2nKjbpq+P3W2vhVLWR9+rKsBHWxuoAUxGKFD3UYwS9W402SDf7OzOIwu1TaR4Z mJ5g== X-Gm-Message-State: ALQs6tCQhSinDhmPxShpab/FjkpNHbXZql5O9tUHYAeL14vWVxo5iI7/ eGXgltWhC+DpH8MPNYejPXaLVCzEL/mOTPZTIgH5kw== X-Google-Smtp-Source: AB8JxZpYcEsX6GlvE9kSAH8nYiUWx78zR41aa0IIRTcumyEMhQBzgf81mrHAWkHJJGgvkBrOpccDbYQaLpxn20O0SEc= X-Received: by 2002:a50:a802:: with SMTP id j2-v6mr59328177edc.138.1525860255055; Wed, 09 May 2018 03:04:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.80.212.155 with HTTP; Wed, 9 May 2018 03:04:14 -0700 (PDT) In-Reply-To: <152582949096.6809.7296761547758528147.stgit@localhost.localdomain> References: <152582834896.6809.14521072557832633661.stgit@localhost.localdomain> <152582949096.6809.7296761547758528147.stgit@localhost.localdomain> From: Alejandro Lucero Date: Wed, 9 May 2018 11:04:14 +0100 Message-ID: To: Andy Green Cc: dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v2 08/18] drivers/net/nfp: fix buffer overflow in fw_name 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: Wed, 09 May 2018 10:04:15 -0000 On Wed, May 9, 2018 at 2:31 AM, Andy Green wrote: > /home/agreen/projects/dpdk/drivers/net/nfp/nfp_net.c: In > function =E2=80=98nfp_pf_pci_probe=E2=80=99: > /home/agreen/projects/dpdk/drivers/net/nfp/nfp_net.c:3160: > 23: error: =E2=80=98%s=E2=80=99 directive writing up to 99 bytes into a > region of size 76 [-Werror=3Dformat-overflow=3D] > sprintf(fw_name, "%s/%s.nffw", DEFAULT_FW_PATH, serial); > > Signed-off-by: Andy Green > --- > drivers/net/nfp/nfp_net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c > index 199aac40b..d5f0e54e8 100644 > --- a/drivers/net/nfp/nfp_net.c > +++ b/drivers/net/nfp/nfp_net.c > @@ -3144,7 +3144,7 @@ nfp_fw_upload(struct rte_pci_device *dev, struct > nfp_nsp *nsp, char *card) > struct nfp_cpp *cpp =3D nsp->cpp; > int fw_f; > char *fw_buf; > - char fw_name[100]; > + char fw_name[130]; > char serial[100]; > struct stat file_stat; > off_t fsize, bytes; > > I would prefer to modify the serial char array size instead, and considering the serial name is fixed, it can be set to 40 safely. Thanks!