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,URIBL_BLOCKED,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 E1228C76186 for ; Sat, 20 Jul 2019 20:22:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C147620823 for ; Sat, 20 Jul 2019 20:22:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726262AbfGTUWn (ORCPT ); Sat, 20 Jul 2019 16:22:43 -0400 Received: from orbyte.nwl.cc ([151.80.46.58]:41390 "EHLO orbyte.nwl.cc" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726238AbfGTUWn (ORCPT ); Sat, 20 Jul 2019 16:22:43 -0400 Received: from n0-1 by orbyte.nwl.cc with local (Exim 4.91) (envelope-from ) id 1hovsO-0007qE-Pn; Sat, 20 Jul 2019 22:22:40 +0200 Date: Sat, 20 Jul 2019 22:22:40 +0200 From: Phil Sutter To: Florian Westphal Cc: Pablo Neira Ayuso , netfilter-devel@vger.kernel.org Subject: Re: [nft PATCH 2/2] nfnl_osf: Silence string truncation gcc warnings Message-ID: <20190720202240.GH32501@orbyte.nwl.cc> Mail-Followup-To: Phil Sutter , Florian Westphal , Pablo Neira Ayuso , netfilter-devel@vger.kernel.org References: <20190720185226.8876-1-phil@nwl.cc> <20190720185226.8876-2-phil@nwl.cc> <20190720193628.fysp5cdofer2vi32@breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190720193628.fysp5cdofer2vi32@breakpoint.cc> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netfilter-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netfilter-devel@vger.kernel.org On Sat, Jul 20, 2019 at 09:36:28PM +0200, Florian Westphal wrote: > 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. Ah, thanks! I missed it. Replied to it pointing at my patch, also spotted a typo in his patch. :) Cheers, Phil