]> git.ipfire.org Git - thirdparty/postgresql.git/commit
dict_synonym.c: remove incorrect outlen.
authorJeff Davis <jdavis@postgresql.org>
Mon, 8 Jun 2026 18:47:40 +0000 (11:47 -0700)
committerJeff Davis <jdavis@postgresql.org>
Mon, 8 Jun 2026 18:48:48 +0000 (11:48 -0700)
commitb32df590cce605389415c9b42b87f02bc0d623b8
tree61029e4e91f0186f90901a52ae08c71005ee8d2b
parentcf2bfe07364fc7599952b816ee1b07f221422598
dict_synonym.c: remove incorrect outlen.

Previously, outlen was miscalculated if case_sensitive was false and
str_tolower() changed the byte length of the string. If outlen was too
large, pnstrdup() would stop at the NUL terminator, preventing
overrun. But if outlen was too small, it would cause truncation.

Fix by just removing outlen. It was only used in a single site, which
could just as well use pstrdup().

Discussion: https://postgre.es/m/1101e1a3afbbabb503317069c40374b82e6f4cac.camel@j-davis.com
Reviewed-by: Tristan Partin <tristan@partin.io>
Backpatch-through: 14
src/backend/tsearch/dict_synonym.c