Fix psql_scan crash.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 4 Jun 2024 01:11:05 +0000 (10:11 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 4 Jun 2024 01:30:08 +0000 (10:30 +0900)
commit612e7f4e93e0b6d5bee53883aab9ca3a4c0349b4
treee0cef6c0e63a5c41c2f6d7ca3c218dd05fc6e5e3
parent5dd1775514e1d2220a7551ad3b9562ec138b7c36
Fix psql_scan crash.

It was reported that psql_scan crashes while determining whether a
string in a long query is psql variable (i.e. starting with ":") or
not.

https://github.com/pgpool/pgpool2/issues/54

This is because callback struct were not provided while calling
psql_scan_create().  Later psql_scan() tries to invoke a callback and
crashes because the pointer to the callback struct is NULL. To fix
this, provide PsqlScanCallbacks struct with a NULL pointer inside to
the callback function. With this, psql_scan() avoids to invoke a
callback.

Backpatch to master, V4.5, V4.4, V4.3, V4.2 and V4.1 where psql_scan
was introduced.
src/protocol/pool_proto_modules.c