From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BDD57C76186 for ; Sat, 20 Jul 2019 19:36:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9BF402085A for ; Sat, 20 Jul 2019 19:36:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726141AbfGTTga (ORCPT ); Sat, 20 Jul 2019 15:36:30 -0400 Received: from Chamillionaire.breakpoint.cc ([193.142.43.52]:48670 "EHLO Chamillionaire.breakpoint.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725940AbfGTTga (ORCPT ); Sat, 20 Jul 2019 15:36:30 -0400 Received: from fw by Chamillionaire.breakpoint.cc with local (Exim 4.89) (envelope-from ) id 1hov9g-0000nz-Ro; Sat, 20 Jul 2019 21:36:28 +0200 Date: Sat, 20 Jul 2019 21:36:28 +0200 From: Florian Westphal To: Phil Sutter Cc: Pablo Neira Ayuso , netfilter-devel@vger.kernel.org Subject: Re: [nft PATCH 2/2] nfnl_osf: Silence string truncation gcc warnings Message-ID: <20190720193628.fysp5cdofer2vi32@breakpoint.cc> References: <20190720185226.8876-1-phil@nwl.cc> <20190720185226.8876-2-phil@nwl.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190720185226.8876-2-phil@nwl.cc> User-Agent: NeoMutt/20170113 (1.7.2) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org Phil Sutter wrote: > Albeit a bit too enthusiastic, gcc is right in that these strings may be > truncated since the destination buffer is smaller than the source one. > Get rid of the warnings (and the potential problem) by specifying a > string "precision" of one character less than the destination. This > ensures a terminating nul-character may be written as well. Fernando sent a patch for this already, with the notable difference of altering the size of the destination buffer by one.