aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/tsvector.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/adt/tsvector.c b/src/backend/utils/adt/tsvector.c
index 04c6f33537a..cb36893b960 100644
--- a/src/backend/utils/adt/tsvector.c
+++ b/src/backend/utils/adt/tsvector.c
@@ -491,7 +491,7 @@ tsvectorrecv(PG_FUNCTION_ARGS)
* But make sure the buffer is large enough first.
*/
while (hdrlen + SHORTALIGN(datalen + lex_len) +
- (npos + 1) * sizeof(WordEntryPos) >= len)
+ sizeof(uint16) + npos * sizeof(WordEntryPos) >= len)
{
len *= 2;
vec = (TSVector) repalloc(vec, len);
@@ -537,7 +537,7 @@ tsvectorrecv(PG_FUNCTION_ARGS)
elog(ERROR, "position information is misordered");
}
- datalen += (npos + 1) * sizeof(WordEntry);
+ datalen += sizeof(uint16) + npos * sizeof(WordEntryPos);
}
}