From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from tama50.ecl.ntt.co.jp (tama50.ecl.ntt.co.jp [129.60.39.147]) by dpdk.org (Postfix) with ESMTP id 192781B1CB for ; Mon, 16 Apr 2018 08:08:50 +0200 (CEST) Received: from vc1.ecl.ntt.co.jp (vc1.ecl.ntt.co.jp [129.60.86.153]) by tama50.ecl.ntt.co.jp (8.13.8/8.13.8) with ESMTP id w3G68nur007055; Mon, 16 Apr 2018 15:08:49 +0900 Received: from vc1.ecl.ntt.co.jp (localhost [127.0.0.1]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 0D78FEA80AF; Mon, 16 Apr 2018 15:08:49 +0900 (JST) Received: from jcms-pop21.ecl.ntt.co.jp (jcms-pop21.ecl.ntt.co.jp [129.60.87.134]) by vc1.ecl.ntt.co.jp (Postfix) with ESMTP id 02508EA8087; Mon, 16 Apr 2018 15:08:49 +0900 (JST) Received: from [IPv6:::1] (watercress.nslab.ecl.ntt.co.jp [129.60.13.73]) by jcms-pop21.ecl.ntt.co.jp (Postfix) with ESMTPSA id EE606400AAA; Mon, 16 Apr 2018 15:08:48 +0900 (JST) References: <1523845578-7435-1-git-send-email-shinohara.kenta@lab.ntt.co.jp> From: Yasufumi Ogawa Message-ID: Date: Mon, 16 Apr 2018 15:07:18 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <1523845578-7435-1-git-send-email-shinohara.kenta@lab.ntt.co.jp> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-CC-Mail-RelayStamp: 1 To: Kenta Shinohara , spp@dpdk.org, ferruh.yigit@intel.com X-TM-AS-MML: disable Subject: Re: [spp] [PATCH] spp_vf: change char length to avoid compile error X-BeenThere: spp@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Soft Patch Panel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Apr 2018 06:08:51 -0000 On 2018/04/16 11:26, Kenta Shinohara wrote: > Change character length of SPP_CMD_VALUE_BUFSZ to avoid compile error > on gcc-7. > > Signed-off-by: Kenta Shinohara Hi Kenta, Thank you for your contribution! I also tried to compile met the same problem on Ubuntu 17.10 and gcc ver 7.1. It seems that checking is more strict in gcc ver 7.1 while ver 5.4 on Ubuntu 16.04 LTS. Your patch is working on both of Ubuntu16.04 and 17.10. spp/src/vf/command_proc.c:231:37: error: ‘%s’ directive writing up to 127 bytes into a region of size 112 [-Werror=format-overflow=] sprintf(message, "unknown command(%s)", decode_error->value); ^~ ~~~~~~~~~~~~ In file included from /usr/include/stdio.h:862:0, from /home/ubuntu/dpdk-home/dpdk/x86_64-native-linuxapp-gcc/include/rte_log.h:50, from /home/ubuntu/dpdk-home/spp/src/vf/command_proc.c:4: /usr/include/x86_64-linux-gnu/bits/stdio2.h:33:10: note: ‘__builtin___sprintf_chk’ output between 18 and 145 bytes into a destination of size 128 return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ __bos (__s), __fmt, __va_arg_pack ()); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I think it is acceptable to change buf size from 128 to 111 because command is not so long to exceed over 100 chars in spp_vf. Acked-by: Yasufumi Ogawa > --- > src/vf/command_dec.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/vf/command_dec.h b/src/vf/command_dec.h > index 9f7bada..f9d2120 100644 > --- a/src/vf/command_dec.h > +++ b/src/vf/command_dec.h > @@ -52,7 +52,7 @@ > #define SPP_CMD_NAME_BUFSZ 32 > > /** command value string buffer size (include null char) */ > -#define SPP_CMD_VALUE_BUFSZ 128 > +#define SPP_CMD_VALUE_BUFSZ 111 > > /** string that specify unused */ > #define SPP_CMD_UNUSE "unuse" > -- Yasufumi Ogawa NTT Network Service Systems Labs