8000 Fix possible use of uninitialised value in ts_headline() · prmdeveloper/postgres@b2a9e16 · GitHub
[go: up one dir, main page]

Skip to content

Commit b2a9e16

Browse files
committed
Fix possible use of uninitialised value in ts_headline()
Found during investigation of failure of skink buildfarm member and its valgrind report. Backpatch to all supported branches
1 parent f79a7fa commit b2a9e16

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/backend/tsearch/wparser_def.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,6 +2439,8 @@ mark_hl_words(HeadlineParsedText *prs, TSQuery query, int highlight,
24392439
}
24402440
else
24412441
{ /* shorter cover :((( */
2442+
if (i > q)
2443+
i = q;
24422444
for (; curlen > min_words; i--)
24432445
{
24442446
if (!NONWORDTOKEN(prs->words[i].type))

0 commit comments

Comments
 (0)
0