From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id 2B59B1DB9 for ; Mon, 30 Apr 2018 16:42:40 +0200 (CEST) Received: by mail-wr0-f195.google.com with SMTP id u18-v6so8280136wrg.3 for ; Mon, 30 Apr 2018 07:42:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w+AJHk2IhZDmqQp4+1HW/MjvkKWYEg4fDENToZeTRoQ=; b=WJxOyikkVLjIZnjeuVXvWxiDi4rbsIrd5iW/wkbl1uVtr6A4c5m6EP5lcLC4P3pG9d Bk7PNQ7bU48O38KRdfETdIkc+OphaDCZHhJmMkA1dgcAMSfnQrSz79NDUHOGgs0whKD9 CFBdT6sgMyOy46qnmlp7Geaa45kwMK+HR44IbX01onk1WhjQheM29ioV6ae6/1zwt6Hq irqLokksvWymObRGcmjJa/eFVhmUPLO/IsmJzh/cA4ZnMhXM3hGxfNNc5/e19+cExnUj jCZOiuxtCKn8A3KCrUPDavSiGddt0pymlcDBsAABV/Ng9d3PlXFyyAzW7L7CG5RbKrbk z9Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w+AJHk2IhZDmqQp4+1HW/MjvkKWYEg4fDENToZeTRoQ=; b=K8Ds3ubY2zK4Dm3uhoHZANt0lSv11LinWHYpCPPUWbezbNa8FTpIv+JeA+nZdcu/m/ eiBmEmYVXBy23plkakaoonj/jJXIny3LLk4mKyDNtppVdcsWsObLC41vbtOxvPumZ9mn 9lR5Jsfa8RR6RGCkReFPpqLj2EmZu72agQGDPo7xypw3lBusznHM28UJKHCPiraduYoR cogUu1/B352BD2JYPTFuTnylVxVteR/EfBl3i81+QV6s91hWUaKrr5XRhDRT1HOxpYS9 oXi+KFL1VV39Za8PLZ8A8vShCAne6uollLWCckW4tGhb/piCCiyM2jR0cvF7famFnLFj MX4w== X-Gm-Message-State: ALQs6tApyKs63DjiSlRALIVMwJi/JzUfR2Alvc9N3SM63CEXImOgekjw 7jhZ32SyhwWqRY+wbH6gwnKXFSdsvr4= X-Google-Smtp-Source: AB8JxZr9hsYmh9U0Gpx1tYj0WIjeeAgUy7MvxW3NHHfpKuI5D2R9dxMd7XRUO7fTnWs/O+XKZ2L1QA== X-Received: by 2002:adf:91a2:: with SMTP id 31-v6mr8985738wri.124.1525099359860; Mon, 30 Apr 2018 07:42:39 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id v66sm12011885wmd.41.2018.04.30.07.42.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:42:39 -0700 (PDT) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: dpdk stable Date: Mon, 30 Apr 2018 15:40:24 +0100 Message-Id: <20180430144223.18657-9-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430144223.18657-1-luca.boccassi@gmail.com> References: <20180430140606.4615-80-luca.boccassi@gmail.com> <20180430144223.18657-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'mbuf: fix truncated strncpy' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 14:42:40 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 4905f7ecca8a84444d2e394ea1f9ac88c4a32a2e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Thu, 29 Mar 2018 10:05:30 -0700 Subject: [PATCH] mbuf: fix truncated strncpy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 8ea081f381615308bb872a608ebbdb0aa6c9f90f ] Gcc-8 discovers issue with platform_mempool_ops. rte_mbuf_pool_ops.c:26:3: error: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation] strncpy(mz->addr, ops_name, strlen(ops_name)); Since the ops_name is already checked for size, using strncpy here is unnecessary; just use strcpy. Fixes: a3acc3144a76 ("mbuf: add pool ops selection functions") Signed-off-by: Stephen Hemminger --- lib/librte_mbuf/rte_mbuf_pool_ops.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf_pool_ops.c b/lib/librte_mbuf/rte_mbuf_pool_ops.c index 48cc34200..a1d4699f6 100644 --- a/lib/librte_mbuf/rte_mbuf_pool_ops.c +++ b/lib/librte_mbuf/rte_mbuf_pool_ops.c @@ -23,7 +23,7 @@ rte_mbuf_set_platform_mempool_ops(const char *ops_name) RTE_MEMPOOL_OPS_NAMESIZE, SOCKET_ID_ANY, 0); if (mz == NULL) return -rte_errno; - strncpy(mz->addr, ops_name, strlen(ops_name)); + strcpy(mz->addr, ops_name); return 0; } else if (strcmp(mz->addr, ops_name) == 0) { return 0; @@ -62,7 +62,7 @@ rte_mbuf_set_user_mempool_ops(const char *ops_name) return -rte_errno; } - strncpy(mz->addr, ops_name, strlen(ops_name)); + strcpy(mz->addr, ops_name); return 0; } -- 2.14.2