From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 587A7A04DC; Mon, 19 Oct 2020 10:13:21 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9AED8BE1D; Mon, 19 Oct 2020 10:13:18 +0200 (CEST) Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by dpdk.org (Postfix) with ESMTP id 4749ABC06 for ; Mon, 19 Oct 2020 10:13:17 +0200 (CEST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20201019081305euoutp02eae46cb68a564b1a02872fdaf43aa75b~-VpPD6GI00146301463euoutp02O for ; Mon, 19 Oct 2020 08:13:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20201019081305euoutp02eae46cb68a564b1a02872fdaf43aa75b~-VpPD6GI00146301463euoutp02O DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1603095185; bh=vDmBiW72ztHgDKI1XLxuGW8UVVFrOPrB2EYOfavVT7M=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Ms7crLVi6GGunsRB7yQLSRkCCyL3UlrgZZRCazfW73CC5fq61ZxQEOy410sxQRnV+ ccIaUtJgL6UL0Fv+PwsX3mG8MJqkmRoY63gTTgPB6vX1c3ukoo8xbewaSdInny8p42 93jUFsuSveLvl2u/NpkoFPz9/0ymdcheqZBPAdbw= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20201019081304eucas1p13fbd17175ebb74616d0991b02db4622b~-VpO2RoiJ0289802898eucas1p1m; Mon, 19 Oct 2020 08:13:04 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id DA.91.06318.09A4D8F5; Mon, 19 Oct 2020 09:13:04 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20201019081304eucas1p13abe1eb47f82d4ec7f07961aa21a8e8b~-VpOhGi2x0289002890eucas1p1o; Mon, 19 Oct 2020 08:13:04 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20201019081304eusmtrp1560101405e9499e772194c8101ebcb7b~-VpOgXAFS0409304093eusmtrp1a; Mon, 19 Oct 2020 08:13:04 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-15-5f8d4a90288a Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 7B.11.06314.09A4D8F5; Mon, 19 Oct 2020 09:13:04 +0100 (BST) Received: from [106.210.88.70] (unknown [106.210.88.70]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20201019081303eusmtip1299f4f7d1c7aff456fdc0565573699c4~-VpN8kRX12742527425eusmtip1w; Mon, 19 Oct 2020 08:13:03 +0000 (GMT) To: Ori Kam , Ophir Munk , "dev@dpdk.org" , Raslan Darawsheh Cc: "stable@dpdk.org" , "\"'Lukasz Wojciechowski'\"," From: Lukasz Wojciechowski Message-ID: Date: Mon, 19 Oct 2020 10:13:02 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.1 MIME-Version: 1.0 In-Reply-To: Content-Transfer-Encoding: 8bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprNKsWRmVeSWpSXmKPExsWy7djPc7oTvHrjDdbu07V492k7k8WznnWM FkdfH2G1aNr7jNVi5sEX7Bb/Ov6wO7B5/FqwlNWjt/kdm8fBd3uYApijuGxSUnMyy1KL9O0S uDIen1zBUrCbv+LHs01sDY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PHnWhcbRMlrRonuw4kgtrCA n8TOP0eYuhi5OEQE2hklNkx9yQ6SYBbIlvjS/Z8VouEeo8SC9WUgNpuArcSRmV/B4rwCbhI3 3s9iBrFZBFQl/tztYQKxRQXiJH5M7GWDqBGUODnzCQvIPZwCsRLLZgRDjDeTmLf5ITOELS/R vHU2lC0ucevJfKYJjEKzkHTPQtIyC0nLLCQtCxhZVjGKpJYW56bnFhvqFSfmFpfmpesl5+du YgTG1LZjPzfvYLy0MfgQowAHoxIP74P8nngh1sSy4srcQ4wSHMxKIrxOZ0/HCfGmJFZWpRbl xxeV5qQWH2I0BfptIrOUaHI+MN7zSuINTQ3NLSwNzY3Njc0slMR5OwQOxggJpCeWpGanphak FsH0MXFwSjUwTmVfE2J4+frK2WuOdv+oNH5mbqX06uKMv3EeMw7qb1iqkryntvHNHK8j3dc+ XvyxkE13z4xZ58/G7pNQaD26zW7xET/TzdEXWzNeSETwL5nY7y2xfuI7yxmSeXWHktXnqjvz OSfI39tzuujWSZVrLNW/9nLPa5ZW++nA+ts3VV/v/ryDLcUVkkosxRmJhlrMRcWJAGp7A+y/ AgAA X-CMS-MailID: 20201019081304eucas1p13abe1eb47f82d4ec7f07961aa21a8e8b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20201019074705eucas1p1f58f6357f6f0a498f4a76207ab8873b9 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20201019074705eucas1p1f58f6357f6f0a498f4a76207ab8873b9 References: <20201018142147.11456-1-ophirmu@nvidia.com> Subject: Re: [dpdk-dev] [PATCH v1] app/regex: fix segfault in getopt_long call 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi, W dniu 19.10.2020 o 09:46, Ori Kam pisze: > Hi Ophir, > >> -----Original Message----- >> From: Ophir Munk >> Sent: Sunday, October 18, 2020 5:22 PM >> Subject: [PATCH v1] app/regex: fix segfault in getopt_long call >> >> getopt_long() parses command-line arguments. One of its arguments >> 'longopts' is a pointer to the first element of an array of struct >> option. The last element of the array has to be filled with zeros >> to mark the end of options. For example: >> >> struct option longopts[] = { >> { "help", 0, 0, ARG_HELP}, >> .... >> /* End of options */ >> { 0, 0, 0, 0 } >> }; >> >> This commit adds the last element. Prior to this commit getopt_long() >> continued parsing beyond the longopts[] array which occasionally caused >> segmentation faults. >> >> Fixes: de06137cb295 ("app/regex: add RegEx test application") >> Cc: stable@dpdk.org >> >> Signed-off-by: Ophir Munk >> --- >> app/test-regex/main.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/app/test-regex/main.c b/app/test-regex/main.c >> index 0d35f45..e6080b4 100644 >> --- a/app/test-regex/main.c >> +++ b/app/test-regex/main.c >> @@ -66,7 +66,9 @@ args_parse(int argc, char **argv, char *rules_file, char >> *data_file, >> /* Perf test only */ >> { "perf", 0, 0, ARG_PERF_MODE}, >> /* Number of iterations to run with perf test */ >> - { "nb_iter", 1, 0, ARG_NUM_OF_ITERATIONS} >> + { "nb_iter", 1, 0, ARG_NUM_OF_ITERATIONS}, >> + /* End of options */ >> + { 0, 0, 0, 0 } >> }; >> >> argvopt = argv; >> -- >> 2.8.4 > Acked-by: Ori Kam Acked-by: Lukasz Wojciechowski > Thanks, > Ori Best regards Lukasz -- Lukasz Wojciechowski Principal Software Engineer Samsung R&D Institute Poland Samsung Electronics Office +48 22 377 88 25 l.wojciechow@partner.samsung.com