BUG #15150: Reading uninitialised value in NISortAffixes (tsearch/spell.c)
The Post Office <noreply@postgresql.org>
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: exclusion@gmail.com
Date: 2018-04-12T11:41:17Z
Lists: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 15150
Logged by: Alexander Lakhin
Email address: exclusion@gmail.com
PostgreSQL version: 10.3
Operating system: Debian-8
Description:
When trying to installcheck hunspell_nl_nl
(https://github.com/postgrespro/hunspell_dicts)
(see
https://github.com/postgrespro/hunspell_dicts/blob/master/hunspell_nl_nl/sql/hunspell_nl_nl.sql)
under valgrind, I get the following diagnostics:
==00:01:05:53.421 20772== Conditional jump or move depends on uninitialised
value(s)
==00:01:05:53.422 20772== at 0x4EA2C6: NISortAffixes (spell.c:1966)
==00:01:05:53.423 20772== by 0x4E5AA5: dispell_init (dict_ispell.c:90)
==00:01:05:53.425 20772== by 0x5E83F1: OidFunctionCall1Coll
(fmgr.c:1332)
==00:01:05:53.426 20772== by 0x36427C: verify_dictoptions.part.2
(tsearchcmds.c:399)
==00:01:05:53.426 20772== by 0x365ED2: verify_dictoptions
(tsearchcmds.c:477)
==00:01:05:53.427 20772== by 0x365ED2: DefineTSDictionary
(tsearchcmds.c:460)
==00:01:05:53.427 20772== by 0x4DE511: ProcessUtilitySlow.isra.5
(utility.c:1293)
==00:01:05:53.427 20772== by 0x4DCC70: standard_ProcessUtility
(utility.c:944)
==00:01:05:53.427 20772== by 0x7334815: pgss_ProcessUtility
(pg_stat_statements.c:1062)
==00:01:05:53.427 20772== by 0x7FB5DE4: pathman_process_utility_hook
(hooks.c:946)
==00:01:05:53.427 20772== by 0x320E99: execute_sql_string
(extension.c:763)
==00:01:05:53.427 20772== by 0x320E99: execute_extension_script.isra.7
(extension.c:924)
==00:01:05:53.427 20772== by 0x32187B: CreateExtensionInternal
(extension.c:1529)
==00:01:05:53.427 20772== by 0x321DD7: CreateExtension
(extension.c:1718)
It looks that the following condition in NISortAffixes(IspellDict *Conf)
uses uninitialised ptr->issuffix:
if (ptr == Conf->CompoundAffix ||
ptr->issuffix != (ptr - 1)->issuffix ||
Commits
-
Improve regression test coverage for src/backend/tsearch/spell.c.
- 8bf358c18ec9 11.0 landed
-
Fix bogus affix-merging code.
- ac8ea0f27f3f 9.3.23 landed
- f71d803c8de8 9.4.18 landed
- 906e44d4dc83 9.5.13 landed
- 65a69dfa08e2 11.0 landed
- 40132187ed6a 10.4 landed
- 0f439c8dd289 9.6.9 landed