Re: BUG #15150: Reading uninitialised value in NISortAffixes (tsearch/spell.c)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15150: Reading uninitialised value in NISortAffixes (tsearch/spell.c)
Дата
Msg-id 23884.1523571243@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #15150: Reading uninitialised value in NISortAffixes(tsearch/spell.c)  (Arthur Zakirov <a.zakirov@postgrespro.ru>)
Ответы Re: BUG #15150: Reading uninitialised value in NISortAffixes(tsearch/spell.c)  (Arthur Zakirov <a.zakirov@postgrespro.ru>)
Список pgsql-bugs
Arthur Zakirov <a.zakirov@postgrespro.ru> writes:
>> It looks that the following condition in NISortAffixes(IspellDict *Conf)
>> uses uninitialised ptr->issuffix:
>> if (ptr == Conf->CompoundAffix ||
>> ptr->issuffix != (ptr - 1)->issuffix ||
 
> Yes, you are right. The second condition isn't right. Instead of
> "ptr->issuffix != (ptr - 1)->issuffix" "Affix->type" should be checked
> because we check for uniqueness of affixes.

Yeah, existing code is clearly wrong, patch looks OK, will push.

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.

            regards, tom lane


В списке pgsql-bugs по дате отправления:

Предыдущее
От: PG Bug reporting form
Дата:
Сообщение: BUG #15151: Error with wal replay after planned manual switchover.
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: BUG #15151: Error with wal replay after planned manualswitchover.