Re: Uninitialized var utilized (src/backend/tsearch/spell.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Uninitialized var utilized (src/backend/tsearch/spell.c)
Date: 2020-10-09 14:38:07
Message-ID: CAEudQApqhXUN_+9YJu6p-irfzRzQJqrmis4O+Vor3Pcn95WU3g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em sex., 9 de out. de 2020 às 11:37, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> escreveu:

> Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> writes:
> > Em sex., 9 de out. de 2020 às 11:08, Daniel Gustafsson <daniel(at)yesql(dot)se>
> > escreveu:
> >> To help reviewers, your report should contain an explanation of when
> that
> >> can happen.
>
> > When option "flag" is not handled.
> > if (STRNCMP(pstr, "flag") == 0)
>
> I think what he means is that if the file contains no "flag" command
> before an affix entry then then we would arrive at NIAddAffix with an
> undefined flag buffer. That's illegal syntax according to a quick scan
> of the ispell(5) man page, which explains the lack of complaints; but
> it might be worth guarding against.
>
> Aside from failing to initialize some variables that need it, it looks to
> me like NIImportAffixes is uselessly initializing some variables that
> don't need it. I'd also be inclined to figure out which values are
> actually meant to be carried across lines, and declare the ones that
> aren't inside the loop, just for clarity.
>
Thanks Tom, for the great explanation.

regards,
Ranier Vilela

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-10-09 14:48:59 Re: libpq debug log
Previous Message Tom Lane 2020-10-09 14:37:00 Re: Uninitialized var utilized (src/backend/tsearch/spell.c)