postgresql/contrib/unaccent
Tom Lane c6b3fb4c53 Fix inadequately-sized output buffer in contrib/unaccent.
The output buffer size in unaccent_lexize() was calculated as input string
length times pg_database_encoding_max_length(), which effectively assumes
that replacement strings aren't more than one character.  While that was
all that we previously documented it to support, the code actually has
always allowed replacement strings of arbitrary length; so if you tried
to make use of longer strings, you were at risk of buffer overrun.  To fix,
use an expansible StringInfo buffer instead of trying to determine the
maximum space needed a-priori.

This would be a security issue if unaccent rules files could be installed
by unprivileged users; but fortunately they can't, so in the back branches
the problem can be labeled as improper configuration by a superuser.
Nonetheless, a memory stomp isn't a nice way of reacting to improper
configuration, so let's back-patch the fix.
2014-07-01 11:23:01 -04:00
..
expected Print the actual DB encoding in the unaccent regression test. 2009-08-18 16:00:50 +00:00
sql Print the actual DB encoding in the unaccent regression test. 2009-08-18 16:00:50 +00:00
.gitignore Some more gitignore cleanups: cover contrib and PL regression test outputs. 2010-09-22 17:22:53 -04:00
Makefile Fix copy-and-pasteo that might explain some of the buildfarm's 2009-08-18 15:51:16 +00:00
unaccent.c Fix inadequately-sized output buffer in contrib/unaccent. 2014-07-01 11:23:01 -04:00
unaccent.rules Unaccent dictionary. 2009-08-18 10:34:39 +00:00
unaccent.sql.in Make unaccent's install/uninstall scripts look more like all the others. 2009-11-14 18:24:32 +00:00
uninstall_unaccent.sql Make unaccent's install/uninstall scripts look more like all the others. 2009-11-14 18:24:32 +00:00