Avoid null pointer dereference crash after OOM in Snowball stemmers.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 19 Feb 2025 02:23:59 +0000 (21:23 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 19 Feb 2025 02:23:59 +0000 (21:23 -0500)
commit9c46d902b2094ff0019cc335bd7693c0d8350258
tree51cad1a098e3d5fc65abf122cf7f443fb94acecd
parent24a74986a0961d2d1bb859a0c3062a7d1e072799
Avoid null pointer dereference crash after OOM in Snowball stemmers.

Absorb upstream bug fix (their commit
e322673a841d9abd69994ae8cd20e191090b6ef4), which prevents a null
pointer dereference crash if SN_create_env() gets a malloc failure
at just the wrong point.

Thanks to Maksim Korotkov for discovering the null-pointer
bug and submitting the fix to upstream snowball.

Reported-by: Maksim Korotkov <m.korotkov@postgrespro.ru>
Author: Maksim Korotkov <m.korotkov@postgrespro.ru>
Discussion: http://postgr.es/m/1d1a46-67ab1000-21-80c451@83151435
Backpatch-through: 13
src/backend/snowball/libstemmer/api.c