Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f72u2-0003tA-57 for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Apr 2018 17:54:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f72u1-0008Jq-Cj for pgsql-bugs@arkaria.postgresql.org; Fri, 13 Apr 2018 17:54:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f72qo-00063R-Pu for pgsql-bugs@lists.postgresql.org; Fri, 13 Apr 2018 17:51:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f72ql-0006Uo-GP for pgsql-bugs@lists.postgresql.org; Fri, 13 Apr 2018 17:51:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w3DHp08S016386; Fri, 13 Apr 2018 13:51:00 -0400 From: Tom Lane To: Arthur Zakirov cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15150: Reading uninitialised value in NISortAffixes (tsearch/spell.c) In-reply-to: <20180413113447.GA32474@zakirov.localdomain> References: <152353327780.31225.13445405496721177988@wrigleys.postgresql.org> <20180412115638.GA19444@zakirov.localdomain> <23884.1523571243@sss.pgh.pa.us> <20180413113447.GA32474@zakirov.localdomain> Comments: In-reply-to Arthur Zakirov message dated "Fri, 13 Apr 2018 14:34:48 +0300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <16384.1523641860.1@sss.pgh.pa.us> Date: Fri, 13 Apr 2018 13:51:00 -0400 Message-ID: <16385.1523641860@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Arthur Zakirov writes: > On Thu, Apr 12, 2018 at 06:14:03PM -0400, Tom Lane wrote: >> But I see from the code coverage report that this bit is unexercised >> in the regression tests. Any chance of getting a test that covers >> this? I'm worried that this means we also lack any coverage of >> cases where the CompoundAffix array has more than one entry. > I attached the patch. It fixes the following: > - show an error if actual number of affix aliases is greater than > initial number. I wonder is it necessary. But I think it is better to > raise an error than crash, if you set wrong number for AF flag. Good idea, but I tweaked the message wording a bit. > The code coverage still isn't 100% for spell.c. But it is better than > earlier. Indeed. Pushed, thanks! regards, tom lane